Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) ReferenceError: exports is not defined #277

Closed
xyunsh opened this issue Nov 23, 2017 · 8 comments
Closed

Uncaught (in promise) ReferenceError: exports is not defined #277

xyunsh opened this issue Nov 23, 2017 · 8 comments

Comments

@xyunsh
Copy link

xyunsh commented Nov 23, 2017

在utlis中增加一个index.js文件,导出utils中的所有函数:
export * from './utils';

引用dashboard/Analysis.js中引用
import { getTimeDistance } from '../../utils/index';

会报错
Uncaught (in promise) ReferenceError: exports is not defined at eval (webpack-internal:///1355:10) at Object.<anonymous> (0.async.js:2875) at __webpack_require__ (index.js:708) at fn (index.js:113) at eval (webpack-internal:///655:116) at Object.<anonymous> (0.async.js:6) at __webpack_require__ (index.js:708) at fn (index.js:113) at <anonymous> :8000/#/dashboard/analysis:1

@afc163
Copy link
Member

afc163 commented Nov 29, 2017

@afc163
Copy link
Member

afc163 commented Nov 29, 2017

@sorrycc

@nikogu
Copy link
Contributor

nikogu commented Dec 1, 2017

@xyunsh 贴一下你 index.js 的代码

@yesmeck
Copy link
Member

yesmeck commented Dec 1, 2017

我觉得作为新项目不应该再用 babel-plugin-add-module-exports 了,新项目应该跟着标准走。

@xyunsh
Copy link
Author

xyunsh commented Dec 4, 2017

@nikogu 就一句话

export * from './utils';

@afc163
Copy link
Member

afc163 commented Dec 4, 2017

那 roadhog 需要给一个 add-module-exports 的配置开关。

@yesmeck
Copy link
Member

yesmeck commented Jan 29, 2018

roadhog 2 已经去掉 babel-plugin-add-module-export

@sorrycc
Copy link
Contributor

sorrycc commented Jan 29, 2018

babel@7 好像不支持这个插件的。

@issue-sh issue-sh bot removed the Icebox label Feb 6, 2018
dengli1216 pushed a commit to myForkProject/ant-design-pro that referenced this issue Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants