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

fix: avoid using import.meta.url for relative assets if output is not ESM (fixes #9297) #9381

Merged
merged 7 commits into from
Aug 9, 2022
Prev Previous commit
Next Next commit
test: skip inline worker with relative-base
  • Loading branch information
sapphi-red committed Jul 27, 2022
commit da07e4cce02666fe5d25cf68f61180f76bb13953
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ test('TS output', async () => {
await untilUpdated(() => page.textContent('.pong-ts-output'), 'pong', true)
})

test('inlined', async () => {
// TODO: inline worker should inline assets
test.skip('inlined', async () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside inline worker, self.location.href and import.meta.url are both blob:foobar or data:foobar. So new URL('./foo', import.meta.url) will become invalid URL.
Do we need to inline assets for inline workers? Or do we need to show an error for them? Or pass the current url into them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we treat inline workers like lib mode(should we make all the asset to base64)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can. But I'm not sure how this should be handled.

Also this will need much more work and since this wasn't working before this PR, I think we shouldn't include the change in this PR.

await untilUpdated(() => page.textContent('.pong-inline'), 'pong', true)
})

Expand Down