You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue when trying to import a model from an NPM package into my ZenStack project. The import works fine when using a relative path, but fails when using an NPM module. The error message explicitly states:
Cannot find model file {CORRECT PATH}
Steps to Reproduce:
I created a ZenStack project with workspaces and added a package containing a .zmodel file.
Attempted to import the model in my ZenStack schema:
import "my-npm-package/schema.zmodel"; // Fails
Ran the ZenStack CLI:
npx zenstack generate
Expected Behavior:
ZenStack should correctly resolve and use the imported model from the NPM module.
Actual Behavior:
When using a relative path (import "../../node_modules/my-npm-package/schema.zmodel";), the import works as expected.
When using the package (import "my-npm-package/schema.zmodel";), ZenStack throws the following error:
Cannot find model file {CORRECT PATH}
(where {CORRECT PATH} is the actual, valid path where the model exists inside node_modules).
Hi,
I'm encountering an issue when trying to import a model from an NPM package into my ZenStack project. The import works fine when using a relative path, but fails when using an NPM module. The error message explicitly states:
Steps to Reproduce:
.zmodel
file.import "my-npm-package/schema.zmodel"; // Fails
Expected Behavior:
ZenStack should correctly resolve and use the imported model from the NPM module.
Actual Behavior:
import "../../node_modules/my-npm-package/schema.zmodel";
), the import works as expected.import "my-npm-package/schema.zmodel";
), ZenStack throws the following error:{CORRECT PATH}
is the actual, valid path where the model exists insidenode_modules
).Environment:
Reproducible Example:
To make it easier to debug, I’ve created a minimal reproducible example on StackBlitz:
👉 https://stackblitz.com/edit/stackblitz-starters-vtmmfxt3?file=package.json
Additional Context:
node_modules
through workspaces.Any guidance or workaround would be greatly appreciated! Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: