uwdata / arquero

Query processing and transformation of array-backed data tables.
https://idl.uw.edu/arquero/
BSD 3-Clause "New" or "Revised" License
1.29k stars 63 forks source link

NextJS swcMinify is breaking arquero #342

Closed victorgdb closed 9 months ago

victorgdb commented 9 months ago

Hello, just to let you know that:

This code

  let array = aq
    .from(data)
    .orderby(aq.desc('value'))
    .derive({
      cumulative: aq.rolling((d) => op.sum(d.value)),
    })
    .derive({
      share_cumulative: (d) => d.cumulative / op.sum(d.value),
    })
    .derive({
      category: (d) => (d.share_cumulative > 0.98 ? 'Other' : d.label),
    })
    .groupby('category')
    .rollup({
      value: (d) => op.sum(d.value),
    })
    .objects();

Produces the following error when minified

f9f77596-15cf-4aaf-ba75-f89d0c3c52b0

To solve the issue I had to update next.config.js to:

const moduleExports = {
  reactStrictMode: true,
  swcMinify: false,
  experimental: {
    externalDir: true,
    typedRoutes: true,
  },

Or simply remove the faulty code.

Impacted versions:

    "arquero": "^5.2.0",
    "next": "^14.0.4",