Closed alfonsogarciacaro closed 2 years ago
Yes vite was complaining about module
being not defined this is why I put it on the top of the chain.
But I think that if people use an old version of Webpack they can have the same problem too according to message on Gitter.
I think I need to wrap each API in its own try ... with
because otherwise if import
is not defined it can probably break stuff.
Version 4.3.0 should fix this error.
I completely reworked how it was implemented making the code is now cleaner and handling correctly cases like this one.
Sorry @MangelMaxime, forgot to ask you in #30 to wrap the code for HMR with try ... with. This would be helpful because I recently tried to create a bundle with
--define DEBUG
but this didn't work because the bundle complainedmodule
was not defined (I assume something similar will happen withimport.meta
) when it was not served by a dev server like Webpack or Vite.