dvajs / babel-plugin-dva-hmr

Hmr babel plugin for dva.
71 stars 17 forks source link

`cannot read property 'file' of undefined` errors when project uses Babel 7 #14

Closed sltenorio99 closed 5 years ago

sltenorio99 commented 6 years ago

After an upgrade of a work project Babel 7, we experienced cannot read property 'file' of undefined errors with this plugin and webpack wouldn't compile.

Proposed Fix: #13

vagusX commented 6 years ago

any progress on this issue?

ferhatelmas commented 6 years ago

@sorrycc do you have any ETA for reviewing fix ?

YanYuanFE commented 6 years ago

解决办法:安装@babel/plugin-transform-runtime 配置babelrc: { "presets":["@babel/react", "@babel/env"], "plugins": [ "dva-hmr", ["@babel/plugin-proposal-decorators", { "legacy": true }], "@babel/plugin-syntax-dynamic-import", "@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime", [ "import", { "libraryName": "antd", // "libraryDirectory": "es", "style": true } ] ] }

loganfsmyth commented 6 years ago

Would someone be able to make a reproducible example and and let us know in https://github.com/babel/babel/issues/8641 ? This seems like an accidental breakage in Babel 7's code.