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

Module crashes webpack build due to use of new URL('./', import.meta.url) #22609

Open
seanmorris opened this issue Sep 23, 2024 · 0 comments
Open

Comments

@seanmorris
Copy link
Contributor

Emscripten packages include the following line:

scriptDirectory = require('url').fileURLToPath(new URL("./", import.meta.url));

This is completely valid javascript. The issue is that when Webpack tries to bundle it, the bundler will attempt to resolve the URL, due to the new URL("./", import.meta.url) which will crash the bundler when it finds a directory.

This is a relatively longstanding bug in webpack, and since other behaviors depend in it, there is no fix on the horizion.

webpack/webpack#16878

Some very prominent projects are affected by this, and as there is no fix in sight, I'd really like to just make Emscripten webpack-compatible by default, so long as we're not bending over backward for it.

electric-sql/pglite#328

I've submitted the following pull request that changes the notation to something equivalent that Webpack will ignore:

#22605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant