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

vite build error: out of memory #170

Closed
wind2sing opened this issue Apr 7, 2023 · 4 comments
Closed

vite build error: out of memory #170

wind2sing opened this issue Apr 7, 2023 · 4 comments

Comments

@wind2sing
Copy link

------------------------- Fri Apr 07 2023 08:52:51 GMT+0000 (Coordinated Universal Time)
Build started for chat
Ignore warnings for unconsumed build-args if there is any
Step 1/15 : FROM node:19-alpine AS react-client

---> cddebfd13934
Step 2/15 : WORKDIR /client

---> Using cache
---> 91c464694866
Step 3/15 : COPY /client/package*.json /client/

---> Using cache
---> b5a03b177e45
Step 4/15 : RUN npm ci

---> Using cache
---> ebe7b3e1fdc9
Step 5/15 : COPY /client/ /client/

---> Using cache
---> d1d7891ea2c3
Step 6/15 : RUN npm run build

---> Running in 6a30bb67cdab
> chatgpt-clone@0.3.0 build
> vite build
vite v4.2.1 building for production...
transforming...
[vite:css] Complex selectors in ':is(.dark .dark\:placeholder\:text-gray-500)::placeholder' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .focus\:dark\:bg-gray-600):focus' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .disabled\:dark\:hover\:text-gray-400:hover):disabled' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .dark\:placeholder\:text-gray-500)::placeholder' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .focus\:dark\:bg-gray-600):focus' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .disabled\:dark\:hover\:text-gray-400:hover):disabled' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .dark\:placeholder\:text-gray-500)::placeholder' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .focus\:dark\:bg-gray-600):focus' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

[vite:css] Complex selectors in ':is(.dark .disabled\:dark\:hover\:text-gray-400:hover):disabled' can not be transformed to an equivalent selector without ':is()'.
1  |  @tailwind base;
   |   ^
2  |  @tailwind components;
3  |  @tailwind utilities;

✓ 1713 modules transformed.
rendering chunks...

<--- Last few GCs --->

[17:0x7fd7c7c7c210]    31707 ms: Mark-Compact (reduce) 988.9 (1008.5) -> 988.3 (1009.0) MB, 1334.5 / 0.0 ms  (average mu = 0.254, current mu = 0.015) allocation failure; scavenge might not succeed
[17:0x7fd7c7c7c210]    33011 ms: Mark-Compact (reduce) 989.3 (1009.0) -> 988.9 (1009.5) MB, 1294.5 / 0.0 ms  (average mu = 0.139, current mu = 0.007) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

npm
 ERR! path /client

npm 
ERR!
 command failed

npm
 ERR! signal SIGABRT
npm ERR! 
command sh -c vite build



npm ERR! A complete log of this run can be found in:
npm ERR!
     /root/.npm/_logs/2023-04-07T08_53_09_238Z-debug-0.log

{"code":1,"message":"The command '/bin/sh -c npm run build' returned a non-zero code: 1"}
The command '/bin/sh -c npm run build' returned a non-zero code: 1
Build has failed!
----------------------
Deploy failed!
Error: {"code":1,"message":"The command '/bin/sh -c npm run build' returned a non-zero code: 1"}
The command '/bin/sh -c npm run build' returned a non-zero code: 1
@danny-avila
Copy link
Owner

This was reported before and it seems you need more than 1 gb of memory for the vite build #146

reading about the issue , I will also optimize imports and see if there is anything else I can do to optimize the build

you should also read this to see if you can do anything during build time. vitejs/vite#2433

@danny-avila
Copy link
Owner

danny-avila commented Apr 7, 2023

@wind2sing this was addressed and let us know if you still have issues after #172

@wind2sing
Copy link
Author

After this fix, the docker image can now be built successfully. Thanks for your quick handling!

@freedgw

This comment was marked as outdated.

@danny-avila danny-avila mentioned this issue Apr 9, 2023
jinzishuai added a commit to jinzishuai/LibreChat that referenced this issue Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants