theKashey / use-sidecar

Another way to code splitting
MIT License
104 stars 9 forks source link

__assign is not a function #13

Closed michelson closed 1 year ago

michelson commented 1 year ago

Hi, I'm using version 1.0.1 and I've found a rare issue embedding the script into a site, the error is:

TypeError: __assign is not a function at createSidecarMedium

Screen Shot 2023-01-11 at 12 38 52

the build is made with esbuild with target es2020

it seems that the assign function does not exist., and it is supposed that the assign is a function that is loaded from.

any idea what could be causing this?

theKashey commented 1 year ago

That is tslib_1.__assign (the end of https://unpkg.com/browse/use-sidecar@1.0.1/dist/es5/medium.js) and dependency on tslib is explicitly set. So 🤷‍♂️, it should work

michelson commented 1 year ago

Was a problem with requirejs on a page that overrides define() function. it has nothing to do with this library. Thanks for the quick reply Anton.