Out of memory when building with Vite and GitLab & possible solution #14780
Unanswered
ajmas
asked this question in
General - Components / Directives / etc
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR:
Recently I ran into an out of memory issue when building our Vite/Quasar project in GitLab continuous integration and worked around it by disabling the linting during CI.
I have run into an out of memory condition in the past, when using webpack/Quasar, and increasing heap space, as some posts suggest, but this is not an option since it ends up causing the build process to slow to a crawl, probably due to excessive swapping due to exceeding the VM size.
In depth:
Our build in GitLab failed due to a "heap limit Allocation failed - JavaScript heap out of memory". We updated all our dependencies to latest, but that did not make a difference. This meant we needed to take a different approach.
So the failure we got was as follows:
The test stage in the
.gitlab-ci.yml
:What ended up working for us, is running the linter outside of Quasar, as a suggested by one of our devs:
So in the
.gitlab-ci.yml
we adjusted the script in the stage to be:and then in our
quasar.conf.js
:BTW I could have used the is-ci package to see if we were in a CI environment, but the environment variable was enough for our needs.
I am sharing this in case it helps someone else or if anyone sees another approach to this. Also, whether this would be something worth adding to the https://quasar.dev/quasar-cli-vite/linter#disabling-linter page in some form?
A future task would be to do memory profiling of the
quasar build
and see how it varies and spot any potential risk points.Beta Was this translation helpful? Give feedback.
All reactions