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

Trailing comma in new Worker() breaks options parsing #10206

Closed
7 tasks done
developit opened this issue Sep 22, 2022 · 0 comments · Fixed by #10211
Closed
7 tasks done

Trailing comma in new Worker() breaks options parsing #10206

developit opened this issue Sep 22, 2022 · 0 comments · Fixed by #10211

Comments

@developit
Copy link
Contributor

Describe the bug

Similar to #6983, detection of new Worker(new URL('./x', import.meta.url), {type:'module'}) fails when there is a trailing slash in the arguments to the Worker constructor:

const worker = new Worker(
    new URL('./worker.js', import.meta.url),
    {type: 'module'},  // <-- here
);

Removing the trailing comma detects and processes the Worker.

Reproduction

https://stackblitz.com/edit/vitejs-vite-b4earr?file=main.js%3AL6&terminal=dev

System Info

System:
    OS: macOS 12.5.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 72.22 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.8.0 - /opt/homebrew/bin/node
    Yarn: 1.19.2 - /usr/local/bin/yarn
    npm: 8.18.0 - /opt/homebrew/bin/npm
    Watchman: 2022.08.29.00 - /opt/homebrew/bin/watchman

Used Package Manager

yarn

Logs

No response

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant