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

Error: 'EventEmitter' is not exported by node_modules/eventemitter3/index.js #1186

Closed
irayslu opened this issue Oct 25, 2022 · 4 comments
Closed
Assignees

Comments

@irayslu
Copy link

irayslu commented Oct 25, 2022

我按照https://antv-issue-helper.surge.sh上面填写无法填写版本号, 无法提交
image

@irayslu
Copy link
Author

irayslu commented Oct 26, 2022

添加一个exports.EventEmitter = EventEmitter;暂时解决了
image

@irayslu
Copy link
Author

irayslu commented Oct 26, 2022

这样也是可以的 import EventEmitter from 'eventemitter3';
image

@irayslu
Copy link
Author

irayslu commented Oct 26, 2022

rollup配置
var plugins = [
license({
banner: <%= pkg.name %> v<%= pkg.version %> <%= pkg.description %> author : <%= pkg.author %> homepage : <%= pkg.homepage %> bugs : <%= pkg.bugs.url %>,
}),
json(),
nodeResolve({
jsnext: true,
main: true,
browser: true
}),
commonjs(),
rollupBabel.babel({
babelHelpers: 'bundled',
exclude:'node_modules/**'
}),
rollupBabel.getBabelOutputPlugin({
allowAllFormats: true,
configFile: path.resolve(__dirname, '.babelrc')
}),
filesize()
];

@xiaoiver xiaoiver self-assigned this Oct 27, 2022
@xiaoiver
Copy link
Contributor

xiaoiver commented Nov 8, 2022

我在 vite 里也遇到了这个问题。看起来是 EventEmitter 默认导出的问题:
vitejs/vite#10406

可能需要改下引入写法:

import EventEmitter from 'events'

xiaoiver added a commit that referenced this issue Nov 14, 2022
* docs: use dumi

* fix(g-canvaskit): delete surface later to avoid error msg #1209

* fix: support number as a valid type of text content #1208

* docs: add more examples for path

* fix(g-webgl): render arc in path correctly

* docs: update examples of GPGPU

* fix(g-plugin-canvas-picker): convert arc to cubic when picking #1202

* fix(rough): merge opacity into fill/stroke #1213

* fix: import eventemitter by default #1186

* Publish

 - @antv/g-camera-api@1.0.17
 - @antv/g-canvas@1.9.16
 - @antv/g-canvaskit@0.8.16
 - @antv/g-components@1.7.28
 - @antv/g-css-layout-api@1.0.17
 - @antv/g-css-typed-om-api@1.0.17
 - @antv/g-devtool@0.10.28
 - @antv/g-dom-mutation-observer-api@1.0.17
 - @antv/g-gesture@0.0.51
 - @antv/g-image-exporter@0.5.28
 - @antv/g-layout-blocklike@1.7.28
 - @antv/g-lite@1.0.17
 - @antv/g-lottie-player@0.0.14
 - @antv/g-math@1.7.28
 - @antv/g-mobile-canvas-element@0.6.28
 - @antv/g-mobile-canvas@0.8.25
 - @antv/g-mobile-svg@0.8.25
 - @antv/g-mobile-webgl@0.7.31
 - @antv/g-plugin-3d@1.7.28
 - @antv/g-plugin-a11y@0.4.28
 - @antv/g-plugin-annotation@0.2.25
 - @antv/g-plugin-box2d@1.7.28
 - @antv/g-plugin-canvas-path-generator@1.1.28
 - @antv/g-plugin-canvas-picker@1.8.25
 - @antv/g-plugin-canvas-renderer@1.7.31
 - @antv/g-plugin-canvaskit-renderer@1.1.29
 - @antv/g-plugin-control@1.7.28
 - @antv/g-plugin-css-select@1.7.28
 - @antv/g-plugin-device-renderer@1.7.31
 - @antv/g-plugin-dom-interaction@1.7.28
 - @antv/g-plugin-dragndrop@1.6.28
 - @antv/g-plugin-gpgpu@1.7.28
 - @antv/g-plugin-html-renderer@1.7.28
 - @antv/g-plugin-image-loader@1.1.29
 - @antv/g-plugin-matterjs@1.7.28
 - @antv/g-plugin-mobile-interaction@0.7.28
 - @antv/g-plugin-physx@1.7.28
 - @antv/g-plugin-rough-canvas-renderer@1.7.28
 - @antv/g-plugin-rough-svg-renderer@1.7.28
 - @antv/g-plugin-svg-picker@1.7.28
 - @antv/g-plugin-svg-renderer@1.8.25
 - @antv/g-plugin-webgl-device@1.7.28
 - @antv/g-plugin-webgpu-device@1.7.28
 - @antv/g-plugin-yoga@1.7.28
 - @antv/g-shader-components@1.7.28
 - @antv/g-svg@1.8.25
 - @antv/g-web-animations-api@1.0.17
 - @antv/g-web-components@1.7.28
 - @antv/g-webgl@1.7.31
 - @antv/g-webgpu@1.7.31
 - @antv/g@5.13.4
 - @antv/react-g@1.8.25
 - @antv/g-site@1.8.25

* fix(g-plugin-rough): use parsed value for stroke and fill

* Publish

 - @antv/g-plugin-rough-canvas-renderer@1.7.29
 - @antv/g-plugin-rough-svg-renderer@1.7.29
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

2 participants