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

Uncompiled ES6 #127

Closed
gagarin55 opened this issue Mar 30, 2017 · 7 comments
Closed

Uncompiled ES6 #127

gagarin55 opened this issue Mar 30, 2017 · 7 comments
Assignees

Comments

@gagarin55
Copy link

I'm using create-react-app tool, when I try to use web3-privider-engine I receive errors during the build.
I've described issue there facebook/create-react-app#1907

The problem is that you provide some uncompiled ES6 modules. Could you give me please some advice how to resolve it.

@gagarin55
Copy link
Author

After this https://github.com/MetaMask/provider-engine/blob/master/package.json#L18 I even can't run it ;( Why you don't provide compiled npm packages ? ;(

@Moejoe90
Copy link
Contributor

Moejoe90 commented Apr 24, 2017

I am facing exactly the same issue, have you managed to fix this?
I have managed to do a temporary fix, if you go down to version 11.0.0 from 12.0.0 the create-react-app tool will work

@danfinlay
Copy link
Contributor

Possible solutions to this:

  1. We remove ES7 from eth-block-tracker
  2. We declare we are now strictly ES7, and you need to transpile your project using something like babel.
  3. Eth-block-tracker could include transpiling in its build process, and we export that instead.

Looks like we're going to start looking at a better pattern for transpiling eth-block-tracker, and making this reverse-compatible again.

@danfinlay
Copy link
Contributor

We're going to track this in MetaMask too:
MetaMask/metamask-extension#1337

@danfinlay
Copy link
Contributor

Fixed in web3-provider-engine@12.0.2. @Moejoe90 @gagarin55 @LogvinovLeon

@Moejoe90
Copy link
Contributor

Moejoe90 commented Apr 25, 2017

Thanks for the fix, everything is working fine now

@moodysalem
Copy link

moodysalem commented Oct 29, 2017

This happens with react-scripts 1.0.14 and web3-provider-engine 13.3.3 when I try to import the ZeroClientProvider

Failed to minify the code from this file: 

        ./node_modules/web3-provider-engine/dist/ZeroClientProvider.js:30 

Read more here: http://bit.ly/2tRViJ9

This is line 30 of that file

  self._blockTracker.on('block', (jsonBlock) => {

My guess is the arrow function is detected as ES6, and the support of arrow functions is still not great (78%)

I'm just using a rawgit script tag for now and accessing window.ZeroClientProvider

    <script src="https://cdn.rawgit.com/MetaMask/provider-engine/f39dabd9/dist/ZeroClientProvider.js"
            integrity="sha384-1bhcGKfQdEyjqsWD7rhaxbxPKxU8nPn7hZ4wsgGTpMZdKVC8aTLblsgmE3P0g2Tm"
            crossorigin="anonymous"></script>

Actually this may be a newly introduced issue now that I read into the original issue more

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

No branches or pull requests

4 participants