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

"Maximum call stack size exceeded " fixes #4337 #4374

Closed
wants to merge 1 commit into from
Closed

"Maximum call stack size exceeded " fixes #4337 #4374

wants to merge 1 commit into from

Conversation

0zguner
Copy link

@0zguner 0zguner commented May 28, 2016

Fixes " Maximum call stack size exceeded " #4337

I know this is a dirty fix. This might show people how to fix this issue. We also should update Readme about this issue. I'll send PR for Readme file.

Regards!

@nathanmarks
Copy link
Member

@newoga Removing transform-replace-object-assign fixes this... any idea why? (it's causing a stackoverflow when transforming the svg-icons/index.js file)

@0zguner
Copy link
Author

0zguner commented Jun 1, 2016

@nathanmarks @newoga It sounds like a babel issue to me 🤔

@newoga
Copy link
Contributor

newoga commented Jun 1, 2016

@nathanmarks No idea, when did this start happening? I haven't investigated yet but either way I was planning on removing this plugin for next release anyway. I'd probably vote to just do so before wasting too much time on it.

I had opened an issue about removing it some time ago: #3948

@nathanmarks
Copy link
Member

@newoga Ok let's remove it.

@nathanmarks nathanmarks closed this Jun 1, 2016
@nathanmarks nathanmarks reopened this Jun 1, 2016
@nathanmarks nathanmarks closed this Jun 1, 2016
@nathanmarks nathanmarks reopened this Jun 1, 2016
@nathanmarks
Copy link
Member

@newoga Ummm. So it looks like it was just pure coincidence. Now removing it isn't making a different 😄

@0zguner
Copy link
Author

0zguner commented Jun 1, 2016

@nathanmarks can't you use this patch until we can find a decent fix about it ?

@nathanmarks
Copy link
Member

@mzgnr We could, but I want to see what else can be done about it

@nathanmarks
Copy link
Member

@newoga BTW it's only happening if I run the whole ./src folder through -- just babeling the svg-icons folder doesn't trigger the stack overflow. But when I run the whole folder through, it always fails on the svg-icons/index.js file.

@nathanmarks
Copy link
Member

@oliviertassinari We could merge this, I don't see a better option right now after playing with it myself. I think this may need to be posted on the babel phabricator. It's not the file as when the babeling is broken up into smaller parts it doesn't happen.

@newoga
Copy link
Contributor

newoga commented Jun 1, 2016

@newoga Ummm. So it looks like it was just pure coincidence. Now removing it isn't making a different 😄

Oh man! That's frustrating, 😆. I spent sometime installing various older versions of babel and babel related dependencies and didn't get far enough to eliminate the issue either. Looking at their change log though, it looks like babel-traverse has been going through a lot of changes.

@nathanmarks
Copy link
Member

@newoga I have a branch anyways with that facebook implementation copied for the change to address that issue. I'll ask on babel slack too see if anyone knows.

@nathanmarks
Copy link
Member

@nathanmarks nathanmarks added the external dependency Blocked by external dependency, we can’t do anything about it label Jun 1, 2016
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 2, 2016

I'm wondering, that looks like a hacky and temporary workaround. I would rather see this fixed at the Babel level. What do you think about closing this PR and keeping the issue open?

@nathanmarks Thanks for opening an issue on their tracker.

@0zguner
Copy link
Author

0zguner commented Jun 2, 2016

I'm wondering... how you didn't face this issue ? I was not able to build package on v0.15-stable branch without this fix 🤔

@newoga
Copy link
Contributor

newoga commented Jun 2, 2016

I'm wondering... how you didn't face this issue ? I was not able to build package on v0.15-stable branch without this fix 🤔

@mzgnr My only guess is that a newer version of one of our dependencies changed the behavior and is causing this issue. I haven't been able to pinpoint when it happened though.

@0zguner
Copy link
Author

0zguner commented Jun 2, 2016

@newoga Anyways. I was lucky enough to find the fix for this issue. This is the only fix i could find without changing project structure 😐

@nathanmarks
Copy link
Member

nathanmarks commented Jun 2, 2016

We'll use this if babel hasn't fixed the issue before our next release. I agree with @oliviertassinari

@nathanmarks nathanmarks added on hold There is a blocker, we need to wait and removed PR: Needs Review labels Jun 2, 2016
@0zguner
Copy link
Author

0zguner commented Jun 2, 2016

I also agree with @oliviertassinari . https://phabricator.babeljs.io/T7402#78943 here there is an explanation for this issue and his argument is true. stack size parameter adds more horse power to node.js & v8 engine. I think its not mostly babeljs issue its caused by this https://github.com/callemall/material-ui/blob/0.15-stable/src/svg-icons/index.js file. I guess its generated from icon index generator. That is the main problem rather than babel.

@nathanmarks
Copy link
Member

@mzgnr He instructed me to post the issue on phabricator, so he must believe it is something babel should try and accomodate. No? Let's see what he ends up doing.

@@ -23,7 +23,7 @@
"scripts": {
"build": "npm run build:icon-index && npm run build:babel && npm run build:copy-files",
"build:icon-index": "babel-node ./scripts/icon-index-generator.js",
"build:babel": "babel ./src --ignore *.spec.js --out-dir ./build",
"build:babel": "node --stack-size=10000 ./node_modules/.bin/babel ./src --ignore *.spec.js --out-dir ./build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this works on Windows? Shouldnt it be more like node --stack-size=10000 ./node_modules/babel-cli/bin/babel.js ./src --ignore *.spec.js --out-dir ./build?

Because .bin/babel is a linux file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CumpsD I don't use Windows :( Can you test it if you are on Windows ? I can update PR with your suggestions :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly, at least it now processes svg-icons (on Windows) but in the end it errors out with:

npm ERR! [email protected] build:babel: `node --stack-size=10000 ./node_modules/babel-cli/bin/babel.js ./src --ignore *.spec.js --out-dir ./build`
npm ERR! Exit status 3221225725
npm ERR!
npm ERR! Failed at the [email protected] build:babel script 'node --stack-size=10000 ./node_modules/babel-cli/bin/babel.js ./src --ignore *.spec.js --out-dir ./build'.

Not sure yet what it means :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, Google tells me

Exit code 3221225477 is C0000005 or ACCESS_VIOLATION

No clue why though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will continue in the issue :) Have another suggestion

@CumpsD
Copy link
Contributor

CumpsD commented Jun 17, 2016

Would this be an option?

    "build": "npm run build:icon-index && npm run build:babel && npm run build:babel-icons && npm run build:copy-files",
    "build:icon-index": "babel-node ./scripts/icon-index-generator.js",
    "build:babel": "babel ./src --ignore *.spec.js --ignore svg-icons --out-dir ./build",
    "build:babel-icons": "node --stack-size=100000 ./node_modules/babel-cli/bin/babel.js ./src/svg-icons --ignore *.spec.js --out-dir ./build/svg-icons",
    "build:copy-files": "babel-node ./scripts/copy-files.js",

Splitting it into a build without icons and a separate one for the icons.

This works on Windows :)

@nathanmarks
Copy link
Member

@CumpsD would rather do the stack arg as the full build should work

@CumpsD
Copy link
Contributor

CumpsD commented Jun 17, 2016

But it does not :( crashes on index.js in svg-icons

@0zguner 0zguner closed this Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external dependency Blocked by external dependency, we can’t do anything about it on hold There is a blocker, we need to wait
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants