-
-
Notifications
You must be signed in to change notification settings - Fork 67
Module not found: Error: Can't resolve 'url' error with create-react-app/webpack 5 #116
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
Comments
Bump. Same here. Also affecting: https://github.com/anttiviljami/react-openapi-client Several of the same error related to relative import paths I believe. I truncated a chunk of the same issues occuring from the error messages below.
|
i ended up using react app rewired to polyfill the url module. not a great solution but good enough |
Thanks for sharing the solution @sw-yx! Seems the issue is with https://github.com/APIDevTools/json-schema-ref-parser/blob/main/lib/util/url.js#L25 Looks like someone already reported this upstream but the issue was closed with workarounds. Author seems to be open for PRs. Would be glad to uprade the ref parse to a browser compatible version if someone finds a way to get rid of the Node.js dependencies 👍 |
@anttiviljami @sw-yx Hi, I'm trying to add polyfills to create-react-app (react-scripts 5.0.1) but I'm getting an error with copy-anything module:
I installed react-app-rewired (v^2.2.1) and this is my config overrides:
Also, I noted that the import of the copy-anything module is a string in client.js (inside node_modules/openapi-client-axios) file:
/static/media/index.e418469a4f6a33e4f7cc.cjs |
+1 |
Did you find a fix for the copy-anything issue you commented about? I was able to work around it for development by editing the module directling in |
@nathanmargaglio Yes, we use a workaround for now. This is the react-app-rewired final config:
And we must activate the quick: true option in OpenAPIClientAxios in order to bypass the execution of copy-anything. See this: https://github.com/anttiviljami/openapi-client-axios/blob/master/packages/openapi-client-axios/src/client.ts#L145 |
This issue should be fixed with |
I have this issue in v.7.1.3 |
Hi @albiorixUA, just tested this both with vite and CRA, both bundling fine without any extra steps needed. Can you describe your setup where this didn't work? |
I suspect this error is similar to #38 but there is not documented solution:
The text was updated successfully, but these errors were encountered: