Consuming a package from a place outside of where it was generated results in typing errors. #4349
Replies: 2 comments
-
|
This sounds like a usage question and not like a bug in SvelteKit itself, so I converted this into a discussion. If this turns out to not be the case, we can always reconsider. Regarding your question: In your repo I don't see a monorepo setup. For me a monorepo is not just a repository with several independent projects, but something that defines how to glue them together, for example through yarn or pnpm workspaces. The problem is that just referencing the package won't suffice, you need to tell the mode resolving mechanism where to find it. The way to do this would be to make the package appear in the node_modules folder of the consumer, or a node_modules folder above that. For that, the package to consume needs to appear in its |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the quick reply @dummdidumm! In short I expect the output dir of I agree workspaces would be a cleaner solution. Or anything but the solution presented here :D |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I'm trying to make a ui-kit inside a monorepo, which should output in a shared folder after running
npm run packageIt sort of looks like this:
I want the ui-kit project to output inside the shared folder, which is done easily enough using
kit.package. However: when the projects trying to consume this package, vscode throws a fit.When the projects consume directly from
ui-kit/packageare aren't any problems, and I don't really understand why. I've tried messing about with tsconfig.json,Reproduction
Example repo: https://github.com/RickMeijer/example-package-error
Setup
npm run packageoutputs inpackage_internal/packagenpm run packageoutputs topackage_exportednpm run packagein package_externalReproduction steps:
Open
package_consumer/src/routes/index.sveltein vscode, and bask in the error.Logs
No response
System Info
System: OS: macOS 12.1 CPU: (10) arm64 Apple M1 Pro Memory: 80.47 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node npm: 8.3.2 - ~/.nvm/versions/node/v16.13.2/bin/npm Browsers: Chrome: 99.0.4844.51 Firefox: 96.0.2 Safari: 15.2Severity
serious, but I can work around it
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions