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

Filed to resolve import in worker file #16608

Closed
7 tasks done
CurryYangxx opened this issue May 6, 2024 · 1 comment
Closed
7 tasks done

Filed to resolve import in worker file #16608

CurryYangxx opened this issue May 6, 2024 · 1 comment

Comments

@CurryYangxx
Copy link

CurryYangxx commented May 6, 2024

Describe the bug

I try to import this file in web worker file: https://github.com/stoplightio/spectral/blob/develop/packages/ruleset-bundler/package.json
import { bundleAndLoadRuleset } from '@stoplight/spectral-ruleset-bundler/with-loader';
But it show error in dev.
[plugin:vite:import-analysis] Failed to resolve import "@stoplight/spectral-ruleset-bundler/with-loader" from "src/ui/worker/spectral.ts?worker_file&type=module". Does the file exist?

Reproduction

https://stackblitz.com/edit/vitejs-vite-nr7ssd?file=package.json,counter.js,main.js,worker.js&terminal=dev

Steps to reproduce

Just open the reproduce link

System Info

Macos Chrome

Used Package Manager

npm

Logs

[plugin:vite:import-analysis] Failed to resolve import "@stoplight/spectral-ruleset-bundler/with-loader" from "src/ui/worker/spectral.ts?worker_file&type=module". Does the file exist?

at formatError (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:50701:42)
at TransformContext.error (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:50695:13)
at normalizeUrl (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:65932:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:66087:37
at async Promise.all (index 2)
at async TransformContext.transform (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:66008:7)
at async Object.transform (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:51010:20)
at async loadAndTransform (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:53761:27 at formatError (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:50701:42)
at TransformContext.error (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:50695:13)
at normalizeUrl (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:65932:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:66087:37
at async Promise.all (index 2)
at async TransformContext.transform (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:66008:7)
at async Object.transform (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:51010:20)
at async loadAndTransform (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:53761:27)
at async viteTransformMiddleware (file:///Users/curry.yang@konghq.com/dev/Kong/insomnia/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:63615:24

Validations

Copy link

stackblitz bot commented May 6, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant