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

Missing module 'url' #743

Open
Shepard opened this issue May 4, 2023 · 0 comments
Open

Missing module 'url' #743

Shepard opened this issue May 4, 2023 · 0 comments

Comments

@Shepard
Copy link
Contributor

Shepard commented May 4, 2023

I use the parser in a vue-cli project and I tried updating from @postlight/mercury-parser 2.2.1 to @postlight/parser 2.2.3. When I run my project, I get the following error.

 ERROR  Failed to compile with 1 error                                                                                                                                                                                                                                              12:07:40

 error  in ./node_modules/@postlight/parser/dist/mercury.js

Module not found: Error: Can't resolve 'url' in '[...]\node_modules\@postlight\parser\dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
        - install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "url": false }

In commit eb9d0bc the dependency 'url' was removed. This change was first released in 2.2.2 so I assume it's responsible for this error I'm getting.

Adding the 'url' dependency to my project fixes the issue. And it doesn't add any vulnerabilities either (when I run yarn audit).

Was there any particular reason to remove this dependency? What could be different about my environment that I'm getting this error and you (presumably) don't?

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