You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project is Remix SPA and I am using @uniswap/smart-order-router library. (Stackblitz repro is here)
I heard that in order for the library to be built well, first need to add several node polyfills and add Browser to the window object, so I didn't know much about it, but I followed suit.
The real problem is next, if you build it in this state, infinite refresh will occur during preview.
This is because if Remix fails to load the route module, it refreshes. (It is unfortunate that it was difficult to find the cause because there was no particular warning message.)
And the reason for the failure is that JSBI was not bundled properly:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My project is Remix SPA and I am using
@uniswap/smart-order-router
library. (Stackblitz repro is here)I heard that in order for the library to be built well, first need to add several node polyfills and add
Browser
to thewindow
object, so I didn't know much about it, but I followed suit.The real problem is next, if you build it in this state, infinite refresh will occur during
preview
.This is because if Remix fails to load the route module, it refreshes. (It is unfortunate that it was difficult to find the cause because there was no particular warning message.)
And the reason for the failure is that
JSBI
was not bundled properly:There are two solutions I found for this:
When I checked the build chunk, I found the following:
build.commonjsOptions
, theJSBI
class is used as is.resolve.alias
, almost the same code (jsbiUmd
) is created and used while the existingJSBI
is present.Here's what I'm curious about:
build.commonjsOptions
work?resolve.alias
work and why does it change to UMD?I tried to search through various documents, but my brain was overloaded due to lack of basic knowledge.
I would appreciate your help.
Beta Was this translation helpful? Give feedback.
All reactions