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 TypeError: Emitter is not a constructor #323

Closed
Gittekken opened this issue Apr 9, 2018 · 9 comments
Closed

Uncaught TypeError: Emitter is not a constructor #323

Gittekken opened this issue Apr 9, 2018 · 9 comments

Comments

@Gittekken
Copy link

Gittekken commented Apr 9, 2018

Hi, when i try to import reactivesearch I get an error of "Uncaught TypeError: Emitter is not a constructor". I was wondering how to go about solving this issue.

thanks
Ken

@metagrover
Copy link
Contributor

Hi @Gittekken, which version of reactivesearch are you using? Also, are you using it on web/native?

@Gittekken
Copy link
Author

The latest version. "@appbaseio/reactivesearch": "^2.3.3". For the web. At the web console it says could not find module emitter so I npm installed it and now it says Uncaught TypeError: Emitter is not a constructor.

@divyanshu013
Copy link
Contributor

Can you post any errors you're seeing in the browser console and any relevant code? I tried the starter app and it seems to be working fine.

@Gittekken
Copy link
Author

I am not using a starter app. I am using an existing meteor project.

I get this
Unable to resolve some modules:
"emitter" in /C/Users/.../Documents/.../node_modules/stream/index.js (web.browser)
"bufferutil" in /C/Users/.../Documents/.../node_modules/ws/lib/BufferUtil.js (web.browser)
"utf-8-validate" in /C/Users/.../Documents/.../node_modules/ws/lib/Validation.js (web.browser)

If you notice problems related to these missing modules, consider running:
meteor npm install --save emitter bufferutil utf-8-validate

so I installed all of these with npm.

Once I installed them I get "Uncaught TypeError: Emitter is not a constructor" That is all I am seeing just that. There is nothing else.

@siddharthlatest
Copy link
Member

@Gittekken On a first look, it seems like a meteor specific error caused by the stream package. I am not too familiar with the platform to comment, but found this thread where someone had a similar error - https://forums.meteor.com/t/emitter-is-not-a-constructor-meteor-1-3-and-npm/24587.

In the Github repo of the stream package, I found this issue which may be relevant - juliangruber/stream#5.

@Gittekken
Copy link
Author

@siddharthlatest thanks nice find on the stream issue.
Ken

@durdenx
Copy link

durdenx commented May 24, 2018

Is there a solution ? I opened an issue on meteorjs repo.

@Gittekken
Copy link
Author

sorry my memory is bad but yes!! you just change the line to "var Emitter = require('emitter');" in the index.js. just follow what was mentioned in link @siddharthlatest found.
juliangruber/stream#5

@Gittekken
Copy link
Author

and obviously install the modules that meteor wants installed I believe. hope this helps.

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

5 participants