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

Problem at runtime svelte-check #1455

Closed
caesar-exploit opened this issue Apr 22, 2022 · 9 comments
Closed

Problem at runtime svelte-check #1455

caesar-exploit opened this issue Apr 22, 2022 · 9 comments
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release. upstream

Comments

@caesar-exploit
Copy link

Describe the bug

Sometimes when running both scripts the following log is displayed.

"check": "svelte-check --tsconfig ./jsconfig.json"
"check:watch": "svelte-check --tsconfig ./jsconfig.json --watch"

Reproduction

Executing task: pnpm run check <

svelte@0.0.1 check /home/format/Desktop/pj/svelte
svelte-check --tsconfig ./jsconfig.json

====================================
Loading svelte-check in workspace: /home/format/Desktop/pj/svelte
Getting Svelte diagnostics...

Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
at readWasm (/home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/read-wasm.js:8:13)
at wasm (/home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/wasm.js:25:16)
at /home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:264:14
at async SvelteDocumentSnapshot.getMapper (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:82021:58)
at async SvelteDocumentSnapshot.getFragment (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:82003:56)
at async DiagnosticsProviderImpl.getDiagnostics (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:83330:26)
at async PluginHost.tryExecutePlugin (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97255:20)
at async Promise.all (index 2)
at async PluginHost.getDiagnostics (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97037:36)
at async SvelteCheck.getDiagnosticsForFile (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97747:29)
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
at readWasm (/home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/read-wasm.js:8:13)
at wasm (/home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/wasm.js:25:16)
at /home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:264:14
at async SvelteDocumentSnapshot.getMapper (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:82021:58)
at async SvelteDocumentSnapshot.getFragment (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:82003:56)
at async DiagnosticsProviderImpl.getDiagnostics (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:83330:26)
at async PluginHost.tryExecutePlugin (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97255:20)
at async Promise.all (index 2)
at async PluginHost.getDiagnostics (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97037:36)
at async SvelteCheck.getDiagnosticsForFile (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97747:29)
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
at readWasm (/home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/read-wasm.js:8:13)
at wasm (/home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/wasm.js:25:16)
at /home/format/Desktop/pj/svelte/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:264:14
at async SvelteDocumentSnapshot.getMapper (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:82021:58)
at async SvelteDocumentSnapshot.getFragment (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:82003:56)
at async DiagnosticsProviderImpl.getDiagnostics (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:83330:26)
at async PluginHost.tryExecutePlugin (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97255:20)
at async Promise.all (index 2)
at async PluginHost.getDiagnostics (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97037:36)
at async SvelteCheck.getDiagnosticsForFile (/home/format/Desktop/pj/svelte/node_modules/.pnpm/svelte-check@2.7.0_rcp265tljkmwtugt6bheyqlznm/node_modules/svelte-check/dist/src/index.js:97747:29)

svelte-check found 0 errors, 0 warnings, and 0 hints

Expected behaviour

The execution of svelte-check correctly.

System Info

Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2022.1
Codename: kali-rolling

VSCode
1.66.2
dfd34e8260c270da74b5c2d86d61aee4b6d56977
x64

Which package is the issue about?

Svelte for VS Code

Additional Information, eg. Screenshots

No response

@caesar-exploit caesar-exploit added the bug Something isn't working label Apr 22, 2022
@jasonlyu123
Copy link
Member

What is your nodejs version? I suspect this has to do with the experimental fetch API support in node.js 18.0. Looks at where the error is thrown. It looks like source-map would try to fetch the wasm file if it detects fetch

@DetachHead
Copy link
Contributor

same issue, node 18.0.0

@jasonlyu123
Copy link
Member

Does the error persist if you install sourcep-map@0.8.0-beta.0?

@DetachHead
Copy link
Contributor

looks like that fixes it, i had to add the following to my package.json:

{
  "engines": {
    "npm": ">=8.3.0" //overrides are a new feature in npm 8.3.0
  },
  "overrides": {
    "source-map": "0.8.0-beta.0"
  }
}

@caesar-exploit
Copy link
Author

What is your nodejs version? I suspect this has to do with the experimental fetch API support in node.js 18.0. Looks at where the error is thrown. It looks like source-map would try to fetch the wasm file if it detects fetch

I'm using version 18

@caesar-exploit
Copy link
Author

It did not work with the v18 version, I have made a switch with nvm to the LTS version and everything works correctly.

@DetachHead
Copy link
Contributor

@caesar-exploit can you please re-open this, it's still an issue that svelte-check doesn't work on the latest nodejs version, source-map needs to be updated in its package.json

@caesar-exploit
Copy link
Author

@DetachHead Do they have to do this directly in the project?

@DetachHead
Copy link
Contributor

yeah, i've just made a PR fixing it #1456

dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Apr 28, 2022
With new, maintained, no-WASM, sync library which is just better all around
sveltejs#1141
sveltejs#1455
dummdidumm added a commit that referenced this issue Apr 29, 2022
With new, maintained, no-WASM, sync library which is just better all around
#1141
#1455
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release. upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants