-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 is not a constructor (esm/commonjs differences) #821
Comments
Reverting to Both eth_chainId and net_version fail with "no response" Debugging deeper in the send method shows that we hit the same error
|
Forcing web to 5.0.0-beta.136 fixies it When using yarn workspaces, up this in the top level package.json
|
Oh, when upgrading the beta, you may need to remove the This requirement will be going away soon. :) |
I always do this, we run a quite complex monorepo with several active branches, it is a given to make sure you have the right one when stuff is wonkey. In this case, I have several packages depending on some parts of the new separate ethers packages. They require But besides that, I have the strong suspicion that, at least in combination with a create-react-app / webpack frontend, the recent changes to |
Yes, a actually have a script to handle exactly that case, but that means updating every package version. Which maybe its a good time to do that anyways. :) Does the react part use ESM or UMD? What if you import |
It appears to be using the esm version. But just to be clear so we are not focussing on the wrong issue :)
|
Does your webpack config specify the "browser" field in the mainFields? Because the URL package is not used in any of the browser versions of the web packages... It sounds like it is pulling the node version in, instead of the browser version. |
And what if you pull in the “ethers” package directly, instead of the sub-package? There are a lot of steps in producing a dist build, I wonder if one of those steps would help. |
This is a plain create-react-app with no access to the webpack config. We do use typescript though, so maybe that will take the node version and not the browser version.
Currently, I do not have the time to redo the implementation as I made it work and we have an urgent side project that needs completing. If you could keep this open until I can switch back that would be much appreciated. (in case nobody else has the same issue) |
Sure thing. :) |
Can you try the latest beta version, 5.0.0-beta.192? I think this should be fixed along with the issue #874, if you need more details. I should have linked the fix to this issue too, but didn’t notice the relation until I was cleaning up some issues. |
Happy camper here! Sorry for not helping out with the debugging |
No worries. All that matters is we found it. :) Not sure who to open a bug against upstream though; it’d be nice to help them fix this for future users... |
Getting stuck on a really weird webpack/url issue
I have the most simple code ("@ethersproject/providers": "5.0.0-beta.164")
Which fails with (on runtime, not compile time)
and the corresponding code in geturl is
It picks the esm compiled versions, when I check the non esm versions it actually includes URL like so
Totally unclear on why this suddenly started happening though...
The text was updated successfully, but these errors were encountered: