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

Importing 0x.js #17

Closed
leoplct opened this issue Jun 12, 2018 · 5 comments
Closed

Importing 0x.js #17

leoplct opened this issue Jun 12, 2018 · 5 comments

Comments

@leoplct
Copy link

leoplct commented Jun 12, 2018

ember install ember-auto-import
npm install 0x.js --save-dev

and put this into application.js controller (btw where is best place to have it globally available?)

import { ZeroEx } from '0x.js';

but if I log in console "ZeroEx" is undefined

@ef4
Copy link
Collaborator

ef4 commented Jun 12, 2018

Thanks for reporting this bug. It looks like 0x.js depends on a lot of node-specific things that Rollup can't easily package. I was able to get further by adding some additional rollup plugins, but I think it depends on some modules that can't run in strict mode, which means Rollup is going to have a hard time with them.

It looks like 0x.js uses webpack when they build their UMD package, which makes me think we can solve this by adding a webpack-based strategy to ember-auto-import.

@ef4
Copy link
Collaborator

ef4 commented Jun 13, 2018

I think this is fixed in 0.2.2 where I made webpack the default.

@ef4 ef4 closed this as completed Jun 13, 2018
@leoplct
Copy link
Author

leoplct commented Jun 13, 2018

If I try to import it, the object ZeroEx is undefined

@ef4
Copy link
Collaborator

ef4 commented Jun 13, 2018

I can't reproduce, I have a working ZeroEx object using ember-auto-import 0.2.2, ember-cli 3.1.2, 0x.js 0.38.3.

@ef4 ef4 reopened this Jun 13, 2018
@leoplct
Copy link
Author

leoplct commented Jun 16, 2018

Removed node_modules and updating all and it works.
Thank you

@leoplct leoplct closed this as completed Jun 16, 2018
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