Open KapilGahlot opened 6 years ago
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
I fixed the issue in #6
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
emitter-component@1.1.1
node_modules/emitter-component
emitter-component@"^1.1.1" from stream@0.0.2
node_modules/stream
stream@"0.0.2" from the root project
Please merge https://github.com/juliangruber/stream/pull/6, this is blocking our project.
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
@barbalex thanks for the fix. saved my day !
@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
@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.
@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.
@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.
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