cube-js / cube-js/cube

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

Open
#6,815 3 comments 15 reactions 1 assignee Claimed by @igorlukanin View on GitHub
backend:cli
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Describe the bug**
The `cubejs-cli generate -t ` fails with the following error:
``` bash
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:
```bash
npx cubejs-cli generate -t
```

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

**Version:**
0.32.27 with `package.json`:
```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](https://github.com/cube-js/cube/blob/master/CHANGELOG.md#0320-2023-03-02).
As additional note, the `@cubejs-backend/schema-compiler/scaffolding/ScaffoldingTemplate.js` file no longer exists.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.