-
Notifications
You must be signed in to change notification settings - Fork 42
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
Building takes forever and fails with 95% emittingnpm ERR! code ELIFECYCLE #26
Comments
There were some performance problems in an older version of Could you try doing that StaticHttp request starting from a fresh clone of the repo (and just outputting some raw data in the view)? That will clarify what's going on. I suspect that you're most likely on an older version, but either way having a minimal app will reduce some variables. |
Thanks for the quick response! I'm on the latest versions of both packages already. Could this maybe be a problem with the node version? I'm using v10.22.1 on guix on WSL2. I can try to remove most of the rest of my app, the StaticHttp request is pretty involved already. |
OK, these are actually two issues: I tried just cloning the original repo and doing nothing but |
That request is pretty involved as I said and does need quite a bit from my original Elm app (including Model, Msg, update, init), but I managed to not use everything else (so nothing from my app gets viewed at all), which brought the generated js files (in tmp) down from 1.2M to 975K. It still takes a long time to build and it still crashes, but that was to be expected, I guess, since building the pure repo alone does crash, too. The npm log it mentions in the crash doesn't seem to contain anything helpful:
|
I tried again today with a native Ubuntu. Different outcome, but not too great either. Build takes about 12 minutes, and ALMOST finishes, but then this happens:
|
Oops, this same error happens on a freshly cloned copy of elm-pages-starter as well (after about 30s build). So the long build is my app's fault, but the errors seem to depend on the npm version or something else. Btw: |
I just updated the entire distribution (ubuntu studio focal), and now the error is gone (nb: neither node nor npm was updated) and I just get a warning:
The fascinating thing is that this only worked in the pure elm-pages-starter repo. My complete app still throws the same error as above. Maybe this is just a timeout or something like that? |
We did some performance benchmarking to find bottlenecks, discussed in this thread: dillonkearns/elm-pages#137. The main finding was that rendering images in puppeteer, and using the headless browser in general, was causing a bottleneck for the number of pages it could build. And it was sometimes causing errors. I made some performance improvements in a recent release, but the build is still using puppeteer under the hood to pre-render pages. So it's possible that that's a source of issues in your app. I built the beta build step to address those issues. It's not ready for the main release quite yet because I'm working on the recommended workflow for installing NPM packages to use with the new approach (which is no longer based on webpack). But it's stable and I'm using it to build elm-pages.com, elm-radio.com, and several other sites. So you could give it a try if you're not relying on NPM packages in your JS bundle right now: https://github.com/dillonkearns/elm-pages/blob/master/docs/7.0.0-elm-package-upgrade-guide.md#2---beta-build-command. |
Thanks, I'll try that ASAP.
Dillon Kearns <[email protected]> schrieb am Fr., 22. Jan. 2021,
16:30:
… We did some performance benchmarking to find bottlenecks, discussed in
this thread: dillonkearns/elm-pages#137
<dillonkearns/elm-pages#137>. The main finding
was that rendering images in puppeteer, and using the headless browser in
general, was causing a bottleneck for the number of pages it could build.
And it was sometimes causing errors.
I made some performance improvements in a recent release, but the build is
still using puppeteer under the hood to pre-render pages. So it's possible
that that's a source of issues in your app. I built the beta build step to
address those issues. It's not ready for the main release quite yet because
I'm working on the recommended workflow for installing NPM packages to use
with the new approach (which is no longer based on webpack).
But it's stable and I'm using it to build elm-pages.com, elm-radio.com,
and several other sites. So you could give it a try if you're not relying
on NPM packages in your JS bundle right now:
https://github.com/dillonkearns/elm-pages/blob/master/docs/7.0.0-elm-package-upgrade-guide.md#2---beta-build-command
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFQNEGGMCUJI7BTQUJZFHLS3GKZBANCNFSM4WKZMM7A>
.
|
Running elm-pages-beta crashes immediately for me:
|
That sounds like a platform-specific spawn issue. I know that |
Unfortunately, the same is happening on my native Ubuntu installation. |
Thanks for checking. Could you try this: npm install --save-dev elm-optimize-level-2
npx elm-pages-beta I think the current beta build script is expecting |
On guix/WSL, I seem to have too old a node version for this:
And the same problem on Ubuntu: I'll see if I can get node >= 12 running ... |
Using node 12 from snap on Ubuntu, the beta build is working! Thank you for your help! It still takes more than 10 minutes, but maybe that's because I use unoptimizedRequests for getting csv data. |
BTW, is there a develop mode for the beta build? |
Not yet, but there definitely will be before it goes out of beta! I'm glad that it's working now on Node 12! I still wouldn't expect it to take 10 minutes. I wonder where the bottleneck is. If you're able to share some code then I could see if I can reproduce it and debug it a bit. I'd also be curious how the performance is through regular HTTP and parsing in vanilla Elm for comparison. Does that run in a few seconds or so? |
The build has actually become pretty fast now, on the order of 10 seconds. When it was more than 10 minutes, I used to do a lot of calculation in the StaticHttp request, as in the request definition in this file: https://github.com/netpositive-money/elm-pages/blob/064239ae78afecb737af6866b6c312511650b5cb/src/Calculator.elm In regular http, this took a few seconds including downloading the data before the page got displayed. Now I've moved the data processing beyond the request barrier into the view proper, which isn't ideal (because it seems there's no way for doing proper memoization in elm today), but it's fast enough when I cut the data down to monthly. |
First of all I'm not a 100% sure how to start a production build, couldn't find docs to that effect. But after looking at the package.json, I tried 'npm run build' and it runs for a really long time, fetching stuff, and elm making three times (about 20 minutes I guess), and then it fails:
`stefan@xpsgiraffeguix ~/elm-pages-starter$ npm run build
Dependencies ready!
Success! Compiled 12 modules.
Fetching https://cbeci.org/api/csv
Fetching https://api.blockchain.info/charts/total-bitcoins?timespan=100years&format=csv&cors=true
Dependencies ready!
Success! Compiled 12 modules.
Dependencies ready!
Success! Compiled 12 modules.
95% emittingnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:
elm-pages build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/stefan/.npm/_logs/2021-01-20T04_04_01_987Z-debug.log`
In develop mode, every reload took forever and the page is extremely slow on this project since I started including StaticHttp Requests. Any ideas?
The text was updated successfully, but these errors were encountered: