loadable-components icon indicating copy to clipboard operation
loadable-components copied to clipboard

error in ./node_modules/@loadable/component/dist/loadable.esm.mjs

Open ZhangDubhe opened this issue 2 years ago • 9 comments

🐛 Bug Report

Can't import the named export 'isValidElementType' from non EcmaScript module (only default export is available)

version

5.16.2

ZhangDubhe avatar Dec 19 '23 13:12 ZhangDubhe

I have the same problem:

./node_modules/@loadable/component/dist/loadable.esm.mjs Can't import the named export 'isValidElementType' from non EcmaScript module (only default export is available)

guidrop17 avatar Dec 19 '23 13:12 guidrop17

same problem

webpack 4

yofine avatar Dec 20 '23 06:12 yofine

This is related to https://github.com/gregberge/loadable-components/pull/989, reason unknown

  • this line https://github.com/gregberge/loadable-components/blob/2210bcf43b0106776a872541f57afca1f3569491/packages/component/src/createLoadable.js#L3C35-L3C35 got transpired in a little different way, ie it became import { isValidElementType } from 'react-is'; instead of import * as ReactIs from 'react-is';

Please fallback to version 5.16.1

theKashey avatar Dec 20 '23 11:12 theKashey

I encountered same issue, with Webpack 4.

Falling back to 5.15.x of loadable packages resolved for me. NPM reported no 5.16.1 candiate for @loadable/component.

"@loadable/babel-plugin": "5.15.3",
"@loadable/component": "5.15.3",
"@loadable/server": "5.15.3",
"@loadable/webpack-plugin": "5.15.2",

stevegacka avatar Dec 25 '23 14:12 stevegacka

Correct, 5.15.3 was the previous version.

theKashey avatar Dec 26 '23 04:12 theKashey

5.16.3 has been released with the fix.

theKashey avatar Dec 26 '23 04:12 theKashey

👋 Can someone confirm that the issue is no longer present so I can close the problem? 🙏

theKashey avatar Dec 27 '23 23:12 theKashey

@theKashey 5.16.3 resolved the issue for me! Thank you 🙏

stevegacka avatar Dec 28 '23 21:12 stevegacka

🚀

theKashey avatar Dec 29 '23 03:12 theKashey