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]: create inline worker will throw error #8098

Closed
Yukiniro opened this issue Oct 13, 2024 · 1 comment
Closed

[Bug]: create inline worker will throw error #8098

Yukiniro opened this issue Oct 13, 2024 · 1 comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@Yukiniro
Copy link
Contributor

System Info

System:
OS: macOS 14.6.1
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 16.38 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - /usr/local/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 9.12.1 - /usr/local/bin/pnpm
Browsers:
Chrome: 129.0.6668.100
Edge: 129.0.2792.89
Safari: 17.6

Details

const setup = () => {
  const offscreenCanvas = new OffscreenCanvas(100, 100);
  const gl = offscreenCanvas.getContext("webgl2");

  const program = gl.createProgram();
  gl.linkProgram(program);
  gl.useProgram(program);
};

const worker = new Worker(URL.createObjectURL(new Blob([`(${setup})()`])));
console.log(worker);

It will throw error:

ERROR
Uncaught ReferenceError: _s is not defined
    at handleError (http://localhost:8080/main.js:36548:64)
    at http://localhost:8080/main.js:36568:13

Reproduce link

https://github.com/Yukiniro/reproduce/tree/master/rspack-issue-hot-update-worker

Reproduce Steps

  1. Run pnpm run dev
  2. Go to http://localhost:8080/
@Yukiniro Yukiniro added bug Something isn't working pending triage The issue/PR is currently untouched. labels Oct 13, 2024
@Yukiniro
Copy link
Contributor Author

This is due to react-refresh and has nothing to do with rspack. Here is the link facebook/react#31279.
So, I close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

1 participant