FredKSchott / rollup-plugin-polyfill-node

A modern Node.js polyfill for your Rollup bundle.
Other
176 stars 55 forks source link

Fix buffer-es6 polyfill: Cannot set properties of undefined (setting 'TYPED_ARRAY_SUPPORT') #79

Open YuAnWu0000 opened 10 months ago

YuAnWu0000 commented 10 months ago

See [(https://github.com/parcel-bundler/parcel/issues/2833)] I've tried so many ways to prevent this error and finally found this approach to solve it.

FredKSchott commented 9 months ago

can you move the code back to it's original location, so that the diff is more clear? Also, remove the nuxt settings config file change!

YuAnWu0000 commented 8 months ago

Actually I only change the code order but not content. In my case, the order matters. Function Buffer() needs to be placed before Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : true;

Also, I remove the vscode nuxt setting. Thanks for reminding.