Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Does not work as a CommonJS Module #40

Closed
evanshortiss opened this issue Dec 12, 2017 · 2 comments
Closed

Does not work as a CommonJS Module #40

evanshortiss opened this issue Dec 12, 2017 · 2 comments

Comments

@evanshortiss
Copy link
Member

When using this in a project with browserify or similar tools it fails to work. It gives this error in my Ionic 2 + Angular 4 project - ERROR Error: Uncaught (in promise): TypeError: Lawnchair is not a function

I haven't looked into the exact differences, but it appears that in sync-client.js we load var Lawnchair = require('../libs/lawnchair/lawnchair'); but this does not have module.exports. When I added this it then gives the error Error: Uncaught (in promise): Error: No valid adapter.

I will look to make a PR.

@wtrocki
Copy link
Member

wtrocki commented Dec 12, 2017

Really important issue that was already mentioned many times.
This is happening due to browserify-shim module missing in the top level project.

For now we have workaround to include it in client projects.
Example:
feedhenry-raincatcher/raincatcher-core#199

@evanshortiss
Copy link
Member Author

@wtrocki I recall making that fix in the JS SDK, but I don't think it will work here since the issue is at a source level. Will look into it though, thanks for the feedback!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants