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

URL in Worker constructor not being replaced with actual bundle URL #6579

Closed
mischnic opened this issue Jul 10, 2021 · 0 comments · Fixed by #6582
Closed

URL in Worker constructor not being replaced with actual bundle URL #6579

mischnic opened this issue Jul 10, 2021 · 0 comments · Fixed by #6582

Comments

@mischnic
Copy link
Member

mischnic commented Jul 10, 2021

🐛 bug report

new URL isn't being replaced with some reference to the actual worker bundle

🎛 Configuration (.babelrc, package.json, cli command)

{
	"browserslist": "IE 11",
	"dependencies": {
		"parcel": "2.0.0-nightly.763"
	}
}

yarn parcel build index.html --no-optimize --no-cache

😯 Current Behavior

This is what the type=module page script bundle looks like:

new Worker(new URL("./worker.js", _import.meta.url), {
    type: "module"
});

💻 Code Sample

https://github.com/mischnic/parcel-issue-6579

<script type="module" src="index.js"></script>
// index.js
new Worker(new URL("./worker.js", import.meta.url), { type: "module" });

// worker.js
console.log("worker")

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-nightly.763
@mischnic mischnic changed the title Worker constructor being replaced with final URL URL in Worker constructor not being replaced with actual bundle URL Jul 10, 2021
@devongovett devongovett added this to the v2.0.0-rc.0 milestone Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants