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

[adapter-node] Built app doesn't seem to be able to run standalone (without sveltekit tooling) ERR_INVALID_ARG_VALUE #1681

Closed
paul-schwendenman opened this issue Jun 12, 2021 · 2 comments

Comments

@paul-schwendenman
Copy link

Describe the bug
Runtime error when using the build version of the app produced by adapter-node. This seems to happen when the typescript option is selected, but I am not sure.

Logs
N/A see stacktrace

To Reproduce

  1. npm init svelte@next my-app
  2. select skeleton
  3. select yes for typescript, eslint, and prettier
  4. cd my-app
  5. npm install
  6. npm install -D @sveltejs/adapter-node@next
  7. edit the svelte.config.js to install the adapter: adapter: node(), in kit and import node from '@sveltejs/adapter-node'; at the top
  8. npm run build
  9. node build

Small repo that illustrates the problem:

https://github.com/paul-schwendenman/congenial-octo-rotary-phone

Expected behavior
I'd expect the node application to start up and run on port 3000, but instead it immediately crashes with a 130 exit code

Stacktraces

Stack trace
internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined
    at createRequire (internal/modules/cjs/loader.js:1168:11)
    at file:///home/paul/projects/my-app/build/index.js:1566:18
    at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
    at async Loader.import (internal/modules/esm/loader.js:177:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  code: 'ERR_INVALID_ARG_VALUE'
}

Information about your SvelteKit Installation:

Diagnostics
npx: installed 1 in 1.244s

  System:
    OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 11.85 GB / 15.52 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.0 - ~/.asdf/installs/nodejs/14.17.0/bin/node
    npm: 6.14.13 - ~/.asdf/installs/nodejs/14.17.0/bin/npm
  Browsers:
    Firefox: 89.0
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.25 => 1.0.0-next.25 
    @sveltejs/kit: next => 1.0.0-next.115 
    svelte: ^3.34.0 => 3.38.2 

browser: n/a

Severity

Probably low, and definitely not personally urgent. This seems like it could be a large issue so I figured I'd submit it, but I am pretty convinced that I am just doing something wrong in my setup.

@Conduitry
Copy link
Member

This is a duplicate of #1667.

@paul-schwendenman
Copy link
Author

paul-schwendenman commented Jun 13, 2021 via email

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