Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packages/src/server.ts imports the cookie module but never declares it as a dependency directly #131

Open
d3rpp opened this issue Dec 10, 2024 · 0 comments · May be fixed by #132
Open

packages/src/server.ts imports the cookie module but never declares it as a dependency directly #131

d3rpp opened this issue Dec 10, 2024 · 0 comments · May be fixed by #132
Assignees
Labels
bug Something isn't working

Comments

@d3rpp
Copy link

d3rpp commented Dec 10, 2024

Describe the bug
Normally when using this it mostly isn't an issue since @sveltejs/kit does. However, when you create a sveltekit application, @sveltejs/kit is a devDependency, while trpc-sveltekit is a runtime dependency, meaning if you use something like pnpm filter to prepare a docker container, the cookie dependency is never recognised and as such is never bundled (unless it ends up being inherited by another package).

Leading to the following error within the docker container:

! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-9.9.0.tgz

> **REDACTED** start /prod
> node ./build/index.js

node:internal/modules/esm/resolve:857
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'cookie' imported from /prod/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@sveltejs+vite-plugin-s_eoxvcomicsy2pllrdfge5gcesm/node_modules/trpc-sveltekit/dist/server.js

To Reproduce

  1. Create a PNPM Workspace
  2. Create a SvelteKit Application as a part of this workspace
  3. Follow Example 2: Build multiple Docker images in a monorepo to package that application
  4. Attempt to run the docker container

Expected behavior
It is expected that the cookie module be imported for use in trpc-sveltekit, however, since it is never declared within this repository it is never added to the virtual store by pnpm filter when creating minimal containers.

Additional context
I apologise for not being able to link to the repo where this is a problem as it is private code for a product, I'll try to keep an eye on this and provide any other required details where I can.

Though this should be a fairly straight-forward thing the way I see it.

Thanks 😄

@d3rpp d3rpp added the bug Something isn't working label Dec 10, 2024
@d3rpp d3rpp linked a pull request Dec 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants