Skip to content

Does not work in node as advertised #517

@xnuk

Description

@xnuk

With given package.json:

{
	"type": "module",
	"packageManager": "[email protected]",
	"dependencies": { "sql.js": "1.7.0" }
}

Here's the result of node -e 'require("sql.js")()':

(node:31583) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/deps/undici/undici:4813
            throw new TypeError("Failed to parse URL from " + input, { cause: err });
                  ^

TypeError: Failed to parse URL from /home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.wasm
    at new Request (node:internal/deps/undici/undici:4813:19)
    at Agent.fetch2 (node:internal/deps/undici/undici:5505:29)
    ... 4 lines matching cause stack trace ...
    at /home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.js:158:505
    at new Promise (<anonymous>)
    at initSqlJs (/home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.js:22:24)
    at [eval]:1:18 {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:377:5)
      at URL.onParseError (node:internal/url:563:9)
      at new URL (node:internal/url:643:5)
      at new Request (node:internal/deps/undici/undici:4811:25)
      at Agent.fetch2 (node:internal/deps/undici/undici:5505:29)
      at Object.fetch (node:internal/deps/undici/undici:6332:20)
      at fetch (node:internal/bootstrap/pre_execution:196:25)
      at /home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.js:158:271
      at /home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.js:158:492
      at /home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.js:158:505 {
    input: '/home/[redacted]/node_modules/.pnpm/[email protected]/node_modules/sql.js/dist/sql-wasm.wasm',
    code: 'ERR_INVALID_URL'
  }
}

Node.js v18.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions