Skip to content

Commit 459a4a7

Browse files
committed
fix: Error: Router element is not found: Template Gallery source enumeration returns empty array
1 parent d222980 commit 459a4a7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/cubejs-server-core/dev/templates/AppContainer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class AppContainer {
2929
return new SourceContainer(await AppContainer.fileContentsRecursive(this.appPath));
3030
}
3131

32-
static async fileContentsRecursive(dir, rootPath) {
32+
static async fileContentsRecursive(dir, rootPath, includeNodeModules) {
3333
if (!rootPath) {
3434
rootPath = dir;
3535
}
3636
if (!(await fs.pathExists(dir))) {
3737
return [];
3838
}
39-
if (dir.indexOf('node_modules/') !== -1) {
39+
if (dir.indexOf('node_modules/') !== -1 && !includeNodeModules) {
4040
return [];
4141
}
4242
const files = await fs.readdir(dir);
@@ -51,7 +51,7 @@ class AppContainer {
5151
content
5252
}];
5353
} else {
54-
return AppContainer.fileContentsRecursive(fileName, rootPath);
54+
return AppContainer.fileContentsRecursive(fileName, rootPath, includeNodeModules);
5555
}
5656
}))).reduce((a, b) => a.concat(b), []);
5757
}

packages/cubejs-server-core/dev/templates/TemplatePackage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TemplatePackage {
2828
}
2929

3030
async initSources() {
31-
const sources = await AppContainer.fileContentsRecursive(this.scaffoldingPath);
31+
const sources = await AppContainer.fileContentsRecursive(this.scaffoldingPath, null, true);
3232
this.templateSources = sources
3333
.map(({ fileName, content }) => ({ [fileName]: content }))
3434
.reduce((a, b) => ({ ...a, ...b }), {});

0 commit comments

Comments
 (0)