arquero icon indicating copy to clipboard operation
arquero copied to clipboard

Fails to import under webpack 5 without config overrides because of missing `.mjs` in imports.

Open kitsunde opened this issue 2 years ago • 5 comments

I was trying to setup arquero with react, but it won't resolve because WebPack5 needs fullySpecified as the import paths both in arquero and in the current used version of apache-arrow do not import with .mjs file endings.

rules: [
  {
    test: /\.(js|mjs)$/,
    resolve: {
      fullySpecified: false
  }
  // ...
],

ref: https://github.com/webpack/webpack.js.org/issues/3975

kitsunde avatar Apr 16 '22 16:04 kitsunde

Struggeling with react import as well. Were you able to resolve the problem somehow?

FelizCoder avatar Apr 26 '22 11:04 FelizCoder

@FelizCoder What I wrote above about updating the config with the example is the solution. You need to set fullySpecified to false.

kitsunde avatar Apr 26 '22 11:04 kitsunde

@kitsunde Thank you for the fast Answer. Cannnot find where to paste that snippet.

FelizCoder avatar Apr 26 '22 12:04 FelizCoder

@kitsunde Thank you for the fast Answer. Cannnot find where to paste that snippet.

Follow the ref I posted. It links to the doc update: https://github.com/webpack/webpack.js.org/pull/3981/files if it's still unclear, you might want to find a webpack community to help walk you through how to do it in your webpack config, it's not specific to this project.

kitsunde avatar Apr 26 '22 12:04 kitsunde

Any chance the lib can use proper import syntax (specifying js/mjs extension on imported file)? I am stuck with webpack4, which doesn't support the workaround that webpack5 does. It's summarized well here why webpack5 defaults to fullySpecified: true -- https://github.com/webpack/webpack/issues/11467#issuecomment-769487234

marr avatar Nov 10 '22 14:11 marr