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

bug: WebWorker doesn't work when stencil component library imported to nextjs app #3512

Open
3 tasks done
jeski-bright opened this issue Aug 5, 2022 · 1 comment
Open
3 tasks done
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@jeski-bright
Copy link
Contributor

Prerequisites

Stencil Version

2.13.0

Current Behavior

When trying to use a component which implements a method delegated to a web worker I get a Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL '/_next/static/media/<file_name>.js' is invalid. exception.

Expected Behavior

The web worker starts properly & can communicate with the component.

Steps to Reproduce

  1. Clone the reproduction repo
  2. Run yarn install
  3. Run yarn build
  4. Run yarn dev
  5. Go to localhost:3000 and check the console output.

Code Reproduction URL

https://github.com/jeski-bright/stencil-next-example

Additional Information

This is similar to #2731, however here it almost works, with webpack5 there is no bug with import.meta.url only the parsed url.href is incorrect.

@alicewriteswrongs
Copy link
Contributor

hi @jeski-bright, thanks for filing this issue (and for opening a related PR!). I was able to confirm that the error is happening in your reproduction - thanks for providing that with detailed instructions for use!

I'm going to mark this for ingestion into our backlog and the Stencil team will prioritize root-causing and dealing with the issue.

Thanks again for reporting!

@alicewriteswrongs alicewriteswrongs added the Bug: Validated This PR or Issue is verified to be a bug within Stencil label Aug 12, 2022
@ionitron-bot ionitron-bot bot removed the triage label Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

No branches or pull requests

2 participants