Skip to content

Commit a1e1fee

Browse files
committed
chore: Call isFallbackBuild on usage, because it can fail at startup
1 parent 72ae173 commit a1e1fee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { UserError } from './UserError';
1414
import { ErrorReporter } from './ErrorReporter';
1515

1616
const NATIVE_IS_SUPPORTED = isNativeSupported();
17-
const NATIVE_IS_FALLBACK_BUILD = isFallbackBuild();
1817

1918
const moduleFileCache = {};
2019

@@ -57,7 +56,7 @@ export class DataSchemaCompiler {
5756
* @protected
5857
*/
5958
async doCompile() {
60-
if (NATIVE_IS_SUPPORTED && !NATIVE_IS_FALLBACK_BUILD) {
59+
if (NATIVE_IS_SUPPORTED && !isFallbackBuild()) {
6160
initJinjaEngine({
6261
debugInfo: getEnv('devMode'),
6362
});
@@ -105,7 +104,7 @@ export class DataSchemaCompiler {
105104
);
106105
}
107106

108-
if (NATIVE_IS_FALLBACK_BUILD) {
107+
if (isFallbackBuild()) {
109108
throw new Error(
110109
'Unable to load jinja file because you are using the fallback build of native extension. Read more: ' +
111110
'https://github.com/cube-js/cube/blob/master/packages/cubejs-backend-native/README.md#supported-architectures-and-platforms'

0 commit comments

Comments
 (0)