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

Sveltekit skeleton app can't run in production without the "devalue" package installed #5968

Closed
SylvainGarrigues opened this issue Aug 17, 2022 · 2 comments

Comments

@SylvainGarrigues
Copy link

SylvainGarrigues commented Aug 17, 2022

Describe the bug

Can't run the skeleton app (created with npm create svelte@latest my-app) in production with node build using adapter-node.

Reproduction

# npm create svelte@latest my-app
# cd my-app && npm install && npm install @sveltejs/adapter-node
# [change svelte.config.js to use adapter-node]
# npm run build
# rm -rf node_modules
# npm install --omit=dev
# node build
node:internal/errors:477
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'devalue' imported from my-app/build/server/index.js
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:909:9)
    at moduleResolve (node:internal/modules/esm/resolve:958:20)
    at defaultResolve (node:internal/modules/esm/resolve:1173:11)
    at nextResolve (node:internal/modules/esm/loader:173:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:852:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.7.0

Logs

node:internal/errors:477
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'devalue' imported from my-app/build/server/index.js
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:909:9)
    at moduleResolve (node:internal/modules/esm/resolve:958:20)
    at defaultResolve (node:internal/modules/esm/resolve:1173:11)
    at nextResolve (node:internal/modules/esm/loader:173:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:852:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.7.0

System Info

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 81.00 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Firefox: 102.0.1
    Safari: 15.6
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.86 => 1.0.0-next.86

Severity

blocking an upgrade

Additional Information

Seems to be solved by installing the "devalue" package.
Not a duplicate of #3176, but related to #5944

@Conduitry
Copy link
Member

It is a duplicate of #3176. devalue (among other things) are now prod dependencies of @sveltejs/kit (a dev dependency). SvelteKit no longer bundling its own dependencies just made that problem more noticeable.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2022
@SylvainGarrigues
Copy link
Author

Then shouldn’t we update adapter-node documentation so that it does not recommend to run npm ci —prod to serve the build? That is really misleading as node build/ doesn’t work straight away contrary to what it suggests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants