uwdata / arquero

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

Nuxt 2.0 build failing due to apache-arrow exports #294

Open marr opened 1 year ago

marr commented 1 year ago

I am trying to import arquero into my nuxt v2 project. This is a client-only project, so ESM is being used directly. The errors I see are around apache-arrow:

ERROR in ./node_modules/apache-arrow/ipc/metadata/file.mjs Can't import the named export 'Builder' from non EcmaScript module (only default export is available)

ERROR in ./node_modules/apache-arrow/ipc/metadata/file.mjs Can't import the named export 'ByteBuffer' from non EcmaScript module (only default export is available)

That is when I import like this: import { from, op } from 'arquero'

jheer commented 1 year ago

Hmm. Not sure offhand what is driving the issue, as it appears at first glance to stem from Apache Arrow. In the meantime, you might consider filing an issue with the Arrow folks if you can isolate and replicate the issue outside of Arquero. I'll also flag @domoritz in case he has any insights.

domoritz commented 1 year ago

I don't know what's causing this issue but would be happy to look into it if you can isolate it to arrow.

marr commented 1 year ago

@domoritz Thanks for taking a look. Here is a barebones repro of what I'm seeing: https://github.com/marr/arrow-webpack

If you pull that down, and do:

npm install
npx webpack

You will see what I'm seeing:

ERROR in ./src/index.mjs 14:17-32 Can't import the named export 'tableFromArrays' from non EcmaScript module (only default export is available)

Likely a webpack v4 thing, but maybe worth investigating. Thanks! And thanks @jheer for the quick response.

domoritz commented 1 year ago

We do test webpack in https://github.com/apache/arrow/blob/53b19a9e3fda0c71d8c0f6d5165caa573fb99a80/js/gulp/bundle-task.js#L99. However, it looks like the latest version is 5 and the repo is testing 4. Can you update webpack and try again?

marr commented 1 year ago

Thanks, yes I upgraded locally in my repro repo and it’s fine. Unfortunately, I am stuck on v4 due to a slog of upgrades needed to become “More modern” with vite, etc. nuxt is a pretty big audience and their v2 uses webpack4. I forsee lots of people getting held back with that until vue/nuxt3 become mainstream.

On Thu, Sep 22, 2022 at 10:40 PM Dominik Moritz @.***> wrote:

We do test webpack in https://github.com/apache/arrow/blob/53b19a9e3fda0c71d8c0f6d5165caa573fb99a80/js/gulp/bundle-task.js#L99. However, it looks like the latest version is 5 and the repo is testing 4. Can you update webpack and try again?

— Reply to this email directly, view it on GitHub https://github.com/uwdata/arquero/issues/294#issuecomment-1255743664, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAK2WD2MX46ZCXKPJ73PLDV7UKDBANCNFSM6AAAAAAQTCYD3A . You are receiving this because you authored the thread.Message ID: @.***>

domoritz commented 1 year ago

I see. I won't have the cycles to fix this myself but I'd be happy to review a pull request in arrow.