jsxtools / cqfill

Polyfill for CSS Container Queries
402 stars 4 forks source link

Broken minification in cqfill.mjs #11

Closed nickbeth closed 2 years ago

nickbeth commented 2 years ago

I'm using cqfill@0.6.0 in a react application, and cqfill makes the build fail with the following error:

TypeError: [...]\node_modules\cqfill\polyfill\cqfill.mjs: Duplicate declaration "n"
> 1 | (({every:e,indexOf:t,slice:s}=Array.prototype [rest of the script...]

I unminified the content of the file and could pinpoint the location of the error:

TypeError: C:\DEV\GitHub\eclubpolimi.it\node_modules\cqfill\polyfill\cqfill.mjs: Duplicate declaration "n"
  25 |   y = () => {
  26 |       for (const [e, t, s, n] of d) {
> 27 |           const n = new Set();
     |                 ^
  28 |           for (const t of r) if (s(t, a.get(t))) for (const s of t.querySelectorAll(e)) n.add(s);
  29 |           const o = [];
  30 |           for (const e of n) {

This is the corresponding code https://github.com/jsxtools/cqfill/blob/main/src/export.js#L58 It looks like an issue with minification.