father
father copied to clipboard
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
I got this error message when run "father build":
"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten"
Context
- Father Version: 2.29.2
- Node Version: 12.16.1
- Platform: MAC OS Catalina 10.15.4
same problem, import @ant-design/icon
经过测试,用require就行了,比如: const { PlusCircleFilled } = require('@ant-design/icons');
同样的问题 导入immutable.js
Build cjs with rollup The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten Error when using sourcemap for reporting an error: Can't resolve original location of error. ✖ error Error: 'OrderedSet' is not exported by node_modules/[email protected]@immutable/dist/immutable.js at error (/Users/lambda/code/my-draft-js/node_modules/[email protected]@rollup/dist/rollup.js:5363:30)
@Topgt +1 same in https://github.com/ant-design/ant-design-icons
how to fix ?
https://rollupjs.org/guide/en/#error-this-is-undefined https://github.com/rollup/rollup/issues/1518
father 4 已发布,可尝试升级到最新版:https://github.com/umijs/father/blob/master/docs/guide/migrate.md
旧版本不再维护,感谢支持