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

npm run build failed #1933

Closed
morindo opened this issue Apr 23, 2024 · 3 comments
Closed

npm run build failed #1933

morindo opened this issue Apr 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@morindo
Copy link

morindo commented Apr 23, 2024

Steps To Reproduce

Just follow the Install Evidence tutorial.

npx degit evidence-dev/template my-project
cd my-project
npm install
npm run sources
npm run build

Environment

  • Node version (node -v): 18.12.1
  • npm version (npm -v): 9.8.1
  • OS: Windows 11
  • Browser: Chrome
  • Database: mssql

package.json

{
  "name": "my-evidence-project",
  "version": "0.0.1",
  "scripts": {
    "build": "evidence build",
    "build:strict": "evidence build:strict",
    "dev": "evidence dev --open /",
    "test": "evidence build",
    "sources": "evidence sources",
    "preview": "evidence preview"
  },
  "engines": {
    "npm": ">=7.0.0",
    "node": ">=18.0.0"
  },
  "type": "module",
  "dependencies": {
    "@evidence-dev/bigquery": "^2.0.5",
    "@evidence-dev/core-components": "^4.0.1",
    "@evidence-dev/csv": "^1.0.8",
    "@evidence-dev/databricks": "^1.0.5",
    "@evidence-dev/duckdb": "^1.0.8",
    "@evidence-dev/evidence": "^33.0.1",
    "@evidence-dev/mssql": "^1.0.6",
    "@evidence-dev/mysql": "^1.1.1",
    "@evidence-dev/postgres": "^1.0.5",
    "@evidence-dev/snowflake": "^1.0.4",
    "@evidence-dev/sqlite": "^2.0.4",
    "@evidence-dev/trino": "^1.0.5"
  },
  "overrides": {
    "jsonwebtoken": "9.0.0",
    "trim@<0.0.3": ">0.0.3",
    "sqlite3": "5.1.5"
  }
}

Expected Behavior

The npm run build should complete without error.

Actual Behaviour

I get a build error at the end.

node:internal/event_target:1006
  process.nextTick(() => { throw err; });
                           ^
Error: Failed to get response header "content-length" — it must be included by the `filterSerializedResponseHeaders` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at /)
    at response.headers.get (file:///C:/Users/Dominic/Dev/Sandbox/evidence_wsl/my-project/.evidence/template/.svelte-kit/output/server/index.js:657:19)
    at Response.arrayBuffer (node:internal/deps/undici/undici:6108:46)
    at visit (file:///C:/Users/Dominic/Dev/Sandbox/evidence_wsl/my-project/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:258:69)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:290:10)
    at [kOnMessage] (node:internal/worker:301:37)
    at MessagePort.<anonymous> (node:internal/worker:202:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:731:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)

Node.js v18.12.1
Build failed

file:///C:/Users/Dominic/Dev/Sandbox/evidence_wsl/my-project/node_modules/@evidence-dev/evidence/cli.js:178
                        throw `Build process exited with code ${code}`;
                        ^
Build process exited with code 1
(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js v18.12.1

Workarounds

There is no workaround I can find at the moment.

@morindo morindo added bug Something isn't working to-review Evidence team to review labels Apr 23, 2024
@mcrascal mcrascal removed the to-review Evidence team to review label Apr 23, 2024
@csjh
Copy link
Contributor

csjh commented Apr 23, 2024

Hi Dominic! Thanks for the report - I'm having trouble reproducing on my machines. Are there any major distinguishing features in your environment that you can think of (i.e. using WSL w/ a specific distribution, running in codespaces)?

@morindo
Copy link
Author

morindo commented Apr 23, 2024

Hi Dominic! Thanks for the report - I'm having trouble reproducing on my machines. Are there any major distinguishing features in your environment that you can think of (i.e. using WSL w/ a specific distribution, running in codespaces)?

Thank you for the follow-up.
Yes, I have WSL installed. Btw, I also tried to replicate the problem inside WSL, same end result.

I just asked a colleague and he does not have the problem. I'll investigate the problem on my machine and get back to you.

@morindo
Copy link
Author

morindo commented Apr 23, 2024

Okay, I just installed the latest 18.20.2 LTS version of Node and npm run build on my evidence project is working. I guess it was related with my old node version (v18.12.1 LTS). Found a link about a similar problem with SvelteKit.

nextauthjs/next-auth#9809

Thanks again @csjh

@morindo morindo closed this as completed Apr 23, 2024
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

No branches or pull requests

3 participants