FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 922 forks source link

broadcast-channel package cannot be bundled with @snowpack/plugin-webpack #2576

Closed openscript closed 3 years ago

openscript commented 3 years ago

I've stumbled on an compatibility issue with the broadcast-channel package and snowpack. I've already opened a discussion about this here.

The import here doesn't get properly shimmed. The required field isn't available during the build. If this part is removed, the build works.

Original Discussion: https://github.com/snowpackjs/snowpack/discussions/2450 /cc @melissamcewen

rizrmd commented 3 years ago

For time being you could patch-package this package yourself. I've done several incompatible package for snowpack.

openscript commented 3 years ago

Oh looks great! I didn't know about patch-package. I've forked the repo and worked around here: https://github.com/openscript/broadcast-channel

FredKSchott commented 3 years ago

Glad the workaround is working for you! Sorry, there's not much that we can do here / this is really an issue with either webpack (if you're using it to bundle) or Rollup (which we use to prepare the package). This would need to be fixed in the package itself.