cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
18.01k stars 1.78k forks source link

Error: @cubejs-backend/schema-compiler/scaffolding/ScaffoldingTemplate.js dependency not found. #6815

Open grandimk opened 1 year ago

grandimk commented 1 year ago

Describe the bug The cubejs-cli generate -t <TABLE-NAME> fails with the following error:

Cube Error ---------------------------------------

Error: @cubejs-backend/schema-compiler/scaffolding/ScaffoldingTemplate.js dependency not found. Please run this command from project directory.
    at requireFromPackage (.../node_modules/@cubejs-backend/shared/src/package.ts:56:11)
    at generate (.../node_modules/cubejs-cli/src/command/generate.ts:74:49)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Code: https://github.com/cube-js/cube/blob/c101291275992e301e85cb75cc9c4a6aa69fc16b/packages/cubejs-cli/src/command/generate.ts#L75

To Reproduce From the terminal, run the command:

npx cubejs-cli generate -t <TABLE-NAME>

Expected behavior The generation of the schema of the table indicated in input.

Version: 0.32.27 with package.json:

"devDependencies": {
  "@cubejs-backend/redshift-driver": "0.32.27",
  "@cubejs-backend/server": "0.32.27",
  "cubejs-cli": "0.32.27"
}

Additional context I verified that with version 0.31.46 the command works correctly. I suspect the problem was introduced in version 0.32 when absolute imports were removed. As additional note, the @cubejs-backend/schema-compiler/scaffolding/ScaffoldingTemplate.js file no longer exists.

AlessandroLollo commented 1 year ago

@paveltiunov any news on this?

kikoncuo commented 4 months ago

@paveltiunov Same error on 0.35.56 Running on WSL Ubuntu 22 node version 20

Can corroborate that downgrading to 0.31.46 works and that the problem is with the CLI tool

christopher-leigh commented 3 months ago

+1 to getting this fixed! Would be awesome if this command could output YAML as well 🙂