fanout/reconnecting-eventsource

Vite exception in production builds (TypeError: YW is not a constructor)

Closed this issue · 2 comments

Similar to this issue: #56

In development there aren't any issues, but in the production version using Vite it does not build correctly

Using reconnecting-eventsource 1.4.0

The error is

 TypeError: YW is not a constructor

thanks for the report, I'm looking into this

I'm not really sure why but Vite seemed to use different rules for importing exports.

I've released a 1.5.0 that has no difference in API surface but I've totally redone the build process, and now the package contains separate browser/commonjs/esm/esnext builds. I've tested it to work with vite build / vite preview. Please check it out. I'm going to close this for now, but if you have any problems with it please feel free to reopen.