umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.3k stars 2.65k forks source link

[Bug] 升级依赖后开启mfsu 报错 #7978

Closed sogud closed 2 years ago

sogud commented 2 years ago

What happens?

升级依赖后开启mfsu 报错

ERROR in ./node_modules/react-dnd/dist/esm/index.js 2:0-24
Module not found: Error: Can't resolve './hooks' in 'D:\work\khaos-web\node_modules\react-dnd\dist\esm'
Did you mean 'index.js'?
BREAKING CHANGE: The request './hooks' failed to resolve only because it was resolved as fully specified
(probably because the origin is a '.mjs' file or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
@ ./src/.umi/.cache/.mfsu/mf-va_react-dnd.js 1:0-26 1:0-26
@ container entry ./react-dnd[0]

umi 3.5

关了mfsu可以运行,或者加上

nodeModulesTransform: {
    type: 'none',
  },
holycrypto commented 2 years ago

一样的情况,mark一下关注后续。

hellcoldby commented 2 years ago

mark 关注

quicklearning123 commented 2 years ago

https://github.com/umijs/umi/issues/6766 搜mjs-rule

MisterBoole commented 2 years ago

// config.ts chainWebpack(config) { config.module.rule('mjs-rule').test(/.m?js/).resolve.set('fullySpecified', false); },