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

Version 4.x no longer compiling to es5 #3505

Closed
walkjivefly opened this issue Mar 10, 2018 · 28 comments
Closed

Version 4.x no longer compiling to es5 #3505

walkjivefly opened this issue Mar 10, 2018 · 28 comments
Labels
good first issue Good for newcomers

Comments

@walkjivefly
Copy link

Expected behaviour: not a blank window. I don't know what it should look like, never used it before.
Actual behaviour: blank window.

metamask_01a

Metamask version: 4.2.0
Browser: Chrome Version 46.0.2490.71 (yes, very old, but it's the latest version I can run on this particular machine).
OS: Linux SolydK 201412 (bastardised Debian Wheezy/Jessie hybrid)

Popup log says:

metamask_01b

And background log says:

metamask_02a

These logs don't match any of the other "blank window" reports.

@walkjivefly
Copy link
Author

Chrome web store says it's compatible.

@kumavis
Copy link
Member

kumavis commented Mar 10, 2018

@walkjivefly as @lazaridiscom said your browser is too old. At 2.5 years, its not just a matter of not having the latest features, I'm not confident that your browser is safe to use. If a critical vulnerability is known that affects your browser version, websites might be able to steal your private keys from MetaMask.

That said, you mentioned it used to work. Its likely that with version 4.x we changed our build process and are no longer compiling es7 to es5.

@kumavis kumavis changed the title Blank window when clicking Metamask icon Version 4.x no longer compiling to es5 Mar 10, 2018
@kumavis
Copy link
Member

kumavis commented Mar 10, 2018

For now, you can manually install an older version.

  • Be aware it will not auto update.
  • Be sure you have your seed phrase written down on paper before starting this process.
  • Download a version from before 4.x (https://github.com/MetaMask/metamask-extension/releases?after=v4.1.0)
  • You can drag and drop the downloaded version in the extensions page of chrome.
  • Be sure to disable the old version of metamask, as things break if two are open at once.

@walkjivefly
Copy link
Author

Thanks for the suggestion. I tried 3.14.1 and all 3.x.0 back to 3.4.0; none of them worked. I've never used Metamask before; I think someone else reported they had in some other issue with similar symptoms. I only wanted to install it to have a look at the Origin Protocol demo dApp. Guess I won't be bothering for the time being.

Changing the title won't help other people in the same situation as me find the report and see the suggested workaround. Which is a shame since it might work for them.

If I ever get my machine upgraded I'll have another go. Cheers!

@danfinlay
Copy link
Contributor

Changing the title won't help other people in the same situation as me find the report and see the suggested workaround.

But it will help us fix the issue sooner. Sorry for the hassle, have a good one!

@tmashuang tmashuang added good first issue Good for newcomers P3-soon labels Mar 12, 2018
@ghost ghost mentioned this issue Mar 19, 2018
@danfinlay danfinlay added this to the April 10 Sprint milestone Mar 19, 2018
@ryan-rowland
Copy link
Contributor

@kumavis
Copy link
Member

kumavis commented Mar 21, 2018

The "fix" was reverted because it broke the build process

@ryan-rowland
Copy link
Contributor

ryan-rowland commented Mar 22, 2018

🤦‍♂️ Sorry I broke your build.

Been looking at this for way too long now. Things I found:

  1. The "memory leak" removing the babel step was just a memory overflow because uglify was trying to package your whole library at once because it was all in the same file. Running node with node --max_old_space_size=4096 fixed this.
  2. The "memory leak" was also covering up another issue: running babel wraps the code in a require block, which also breaks everything once loaded into the browser (same breaking behavior my commit caused)
  3. Babel-runtime is huge and almost doubling the size of some minified files
  4. Trying to configure babel to remove const declarations makes me want to pull my hair out.

Tapping out. 🤷‍♂️

@ryan-rowland
Copy link
Contributor

Also: CircleCI approved my PR despite it breaking the build, we might want to update the CI to cover this step of the build process.

@danfinlay
Copy link
Contributor

Captured in #3699.

@Epelzhenya
Copy link

Can anybody tell me with simple language what to do whith this problem? English is not my native language.

@Epelzhenya
Copy link

@lazaridiscom thank you wery much)

@danfinlay danfinlay removed this from the April 10 Sprint milestone Mar 26, 2018
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.2 ETH (123.94 USD @ $619.68/ETH) attached to it.

@gitcoinbot
Copy link

@JonnyBurger Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@JonnyBurger
Copy link

Hi there,

sorry I have to give up this as well.
I figured out the memory issue at least.

The build step was bundle -> minify -> transpile, which gave one big file to Babel and that is why the memory issue occured.
Changing it to transpiling -> bundling -> minifying solved this issue.

However, it's true that is seems very hard to configure Babel to remove all const. Alternatively, I was also not able to set "strict mode" in Babel. Weird because it should work.

So sorry for not being able to deliver.

@vs77bb
Copy link

vs77bb commented Jun 8, 2018

Thanks for the honest update @JonnyBurger and appreciate you taking a look! Have a great weekend.

@gitcoinbot
Copy link

@Platinumwrist Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

2 similar comments
@gitcoinbot
Copy link

@Platinumwrist Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@Platinumwrist Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@erchaves
Copy link

erchaves commented Jun 19, 2018

I'm not 100% sure, but at a glance, I think Babel is not setup to transpile const and let, but traceur could do this for you. It doesn't seem like it would make sense to introduce that into the actual codebase to solve this problem just for really old legacy browsers. But if some folks really needed to find a work around, I suppose they could filter the js through traceur and shim it back in, maybe through a fork of the project or something..

edit: It looks like this might work in theory babel plugin transform-es2015-block-scoping.

@gitcoinbot
Copy link

@rafaelboyero Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@WillBeebe
Copy link

Babel can transpile const and let for sure, you just need to set the right target. It will even add "use strict" to the top of the file.

@gitcoinbot
Copy link

gitcoinbot commented Jul 15, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 8 months, 1 week ago.
Please review their action plans below:

1) ajnauleau has started work.

Utilize Babel for JavaScript compatibility and transpilation

  • JavaScript package that transpiles JavaScript ES6+ code to ES5

Install babel dependencies by running

npm install babel-cli -D
npm install babel-preset-env -D

Create a .babelrc file inside your project and add the following code inside it:

{
"presets": ["env"]
}

Add the following script to your scripts object in package.json:

"build": "babel src -d lib"

Learn more on the Gitcoin Issue Details page.

@ajnauleau
Copy link
Contributor

Looking to be a bit more difficult than I expected, getting errors building gulp at mascara with babel "env"-- will keep posted.

@ajnauleau
Copy link
Contributor

*Fixed, updated to babel-preset-env, just had to change the order of presets to "env", "react", "stage-0"-- now builds.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 0.2 ETH (95.15 USD @ $475.76/ETH) has been submitted by:

  1. @ajnauleau

@vs77bb please take a look at the submitted work:


@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 0.2 ETH (53.15 USD @ $265.77/ETH) attached to this issue has been approved & issued to @ajnauleau.

@ghost
Copy link

ghost commented Dec 27, 2018

@bdresser , it looks like this one can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests