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

emitter module wrong reference? #5

Open
KapilGahlot opened this issue Feb 1, 2018 · 10 comments · May be fixed by #6
Open

emitter module wrong reference? #5

KapilGahlot opened this issue Feb 1, 2018 · 10 comments · May be fixed by #6

Comments

@KapilGahlot
Copy link

Hi,

I see below require statement in your index.js and you have listed emitter-component as one of your dependencies. Should the below line require from emitter-component instead of emitter?

var Emitter = require('emitter');

Your module is a dependency of another module that one of my Meteor apps require. My app threw an error that Emitter is not an constructor but when I changed the require reference as mentioned above, the error got resolved. I am curious that I did not see a similar issue reported by anybody else so not sure how it is working for others?

Regards

@juliangruber
Copy link
Owner

Interesting. Hm, this module hasn't been updated in a while and I haven't used component in a while. Happy to accept any PR that fixes this

@durdenx
Copy link

durdenx commented Jun 13, 2018

I fixed the issue in #6

@barbalex
Copy link

barbalex commented Mar 3, 2023

I am getting this error when building using vite:

"emitter" is imported by "emitter?commonjs-external", but could not be resolved – treating it as an external dependency

Which then breaks preview and production 😢

Also:

PS C:\Users\alexa\capturing> npm why emitter-component
[email protected]
node_modules/emitter-component
  emitter-component@"^1.1.1" from [email protected]
  node_modules/stream
    stream@"0.0.2" from the root project

@barbalex
Copy link

barbalex commented Mar 3, 2023

Please merge #6, this is blocking our project.

@barbalex
Copy link

barbalex commented Mar 3, 2023

For any one else running into this: use path-package (https://www.npmjs.com/package/patch-package) to fix the import as done in https://github.com/juliangruber/stream/pull/6/files

@lucasriondel
Copy link

@barbalex thanks for the fix. saved my day !

@lucasriondel
Copy link

@barbalex i'm still having issues with this library when trying to bundle it with rollup :

 IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
                                                                   ^
TypeError: Cannot read properties of undefined (reading 'prototype')

Did you have the same issues at some point ? running node v18.16.0

@barbalex
Copy link

@lucasriondel no, can't remember having that issue. The project that had our issue is being rebuilt and this part has not been added yet. So I'm not quite up to date right now.

@lucasriondel
Copy link

@barbalex ok so just so you know, using this package on modern version of node is clearly not recommended. I was able to remove it completely and using the built-in stream package from node instead. Everything worked out of the box.

@barbalex
Copy link

@lucasriondel Our app is a web app. There is no node to use it's built-in stream. For a node app your solution makes a lot of sense.

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

Successfully merging a pull request may close this issue.

5 participants