crxjs / chrome-extension-tools

Bundling Chrome Extensions can be pretty complex. It doesn't have to be.
https://crxjs.dev/vite-plugin
2.94k stars 190 forks source link

2.0.0-beta.26 causing vite out of memory errors #936

Open ryanmargono opened 2 weeks ago

ryanmargono commented 2 weeks ago

Build tool

Vite

Where do you see the problem?

Describe the bug

This version is causing some issues with Vite build memory errors. This is especially problematic since this version is required to solve a lot of the new chrome update issues (runtime url, etc).

Reproduction

if you've just upgraded, need to do the following to reproduce. without it, it would work:

  1. delete all node_modules in project
  2. delete your package lock file
  3. pnpm install
  4. dev command

It should throw that error.

Logs

<--- Last few GCs --->

[21303:0x140008000]    48895 ms: Mark-Compact 4055.3 (4139
.1) -> 4053.7 (4139.1) MB, pooled: 0 MB, 5864.83 / 0.00 ms
  (average mu = 0.202, current mu = 0.021) allocation fail
ure; scavenge might not succeed
[21303:0x140008000]    55847 ms: Mark-Compact 4061.6 (4139
.1) -> 4059.9 (4168.1) MB, pooled: 6 MB, 6939.00 / 0.00 ms
  (average mu = 0.089, current mu = 0.002) allocation fail
ure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaSc
ript heap out of memory
----- Native stack trace -----

 1: 0x1024e2670 node::OOMErrorHandler(char const*, v8::OOM
Details const&) [/Users/ethan/.local/share/fnm/node-versio
ns/v22.6.0/installation/bin/node]
 2: 0x1026b9b84 v8::internal::V8::FatalProcessOutOfMemory(
v8::internal::Isolate*, char const*, v8::OOMDetails const&
) [/Users/ethan/.local/share/fnm/node-versions/v22.6.0/ins
tallation/bin/node]
 3: 0x102890d64 v8::internal::Heap::stack() [/Users/ethan/
.local/share/fnm/node-versions/v22.6.0/installation/bin/no
de]
 4: 0x10288f308 v8::internal::Heap::CollectGarbage(v8::int
ernal::AllocationSpace, v8::internal::GarbageCollectionRea
son, v8::GCCallbackFlags) [/Users/ethan/.local/share/fnm/n
ode-versions/v22.6.0/installation/bin/node]
 5: 0x1028846b8 v8::internal::HeapAllocator::AllocateRawWi
thLightRetrySlowPath(int, v8::internal::AllocationType, v8
::internal::AllocationOrigin, v8::internal::AllocationAlig
nment) [/Users/ethan/.local/share/fnm/node-versions/v22.6.
0/installation/bin/node]
 6: 0x102884ee4 v8::internal::HeapAllocator::AllocateRawWi
thRetryOrFailSlowPath(int, v8::internal::AllocationType, v
8::internal::AllocationOrigin, v8::internal::AllocationAli
gnment) [/Users/ethan/.local/share/fnm/node-versions/v22.6
.0/installation/bin/node]
 7: 0x102867edc v8::internal::Factory::NewFillerObject(int
, v8::internal::AllocationAlignment, v8::internal::Allocat
ionType, v8::internal::AllocationOrigin) [/Users/ethan/.lo
cal/share/fnm/node-versions/v22.6.0/installation/bin/node]
 8: 0x102c5ce08 v8::internal::Runtime_AllocateInYoungGener
ation(int, unsigned long*, v8::internal::Isolate*) [/Users
/ethan/.local/share/fnm/node-versions/v22.6.0/installation
/bin/node]
 9: 0x1031d9c74 Builtins_CEntry_Return1_ArgvOnStack_NoBuil
tinExit [/Users/ethan/.local/share/fnm/node-versions/v22.6
.0/installation/bin/node]
10: 0x1032478a4 Builtins_PromiseAllSettled [/Users/ethan/.
local/share/fnm/node-versions/v22.6.0/installation/bin/nod
e]
11: 0x1099cb18c
12: 0x109c33f68
13: 0x109872248
14: 0x1099cab04
15: 0x109872248
16: 0x109b69fb4
17: 0x109872248
18: 0x109788f60
19: 0x109872248
20: 0x109c0ddc0
21: 0x109cd211c
22: 0x109cd0020
23: 0x1032087dc Builtins_ArrayMap [/Users/ethan/.local/share/fnm/node-versions/v22.6.0/installation/bin/node]
24: 0x109b7559c
25: 0x109859910
26: 0x109856cd8
27: 0x109afa054
28: 0x109afadbc
29: 0x1099b1e58
30: 0x109afa054
31: 0x109afadbc
32: 0x1099b68ec
33: 0x10324c658 Builtins_PromiseFulfillReactionJob [/Users
/ethan/.local/share/fnm/node-versions/v22.6.0/installation
/bin/node]
34: 0x103171714 Builtins_RunMicrotasks [/Users/ethan/.loca
l/share/fnm/node-versions/v22.6.0/installation/bin/node]
35: 0x103142af4 Builtins_JSRunMicrotasksEntry [/Users/etha
n/.local/share/fnm/node-versions/v22.6.0/installation/bin/
node]
36: 0x1027e9938 v8::internal::(anonymous namespace)::Invok
e(v8::internal::Isolate*, v8::internal::(anonymous namespa
ce)::InvokeParams const&) [/Users/ethan/.local/share/fnm/n
ode-versions/v22.6.0/installation/bin/node]
37: 0x1027e9dc8 v8::internal::(anonymous namespace)::Invok
eWithTryCatch(v8::internal::Isolate*, v8::internal::(anony
mous namespace)::InvokeParams const&) [/Users/ethan/.local
/share/fnm/node-versions/v22.6.0/installation/bin/node]

System Info

Mac

Severity

blocking all usage of RPCE

jacksteamdev commented 2 weeks ago

2. delete your package lock file

What is the diff between the old and new package-lock files? Deleting the package-lock might cause another dependency to update.

kadirgun commented 2 weeks ago

I get the same error.

Windows WSL2 pnpm version: 2.0.0-beta.28

Edit: I found that the cause of my problem is @tabler/icons-react version 3.20.

ryanmargono commented 2 weeks ago

@kadirgun we are using that too, did you find a working version?

kadirgun commented 2 weeks ago

@kadirgun we are using that too, did you find a working version?

3.11.0 is working properly. I have not tried more advanced versions.

SSTPIERRE2 commented 2 weeks ago

What is the diff between the old and new package-lock files? Deleting the package-lock might cause another dependency to update.

@jacksteamdev Here's the diff of the lockfiles when the issue started please let us know if you find any potential issues, thanks! 🙏

SSTPIERRE2 commented 2 weeks ago

3.11.0 is working properly. I have not tried more advanced versions.

@kadirgun hey man thanks a lot, locking down @tabler/icons-react to v3.11.0 got it working! We were using the caret range specifier where it was resolving to v3.21.0 which wasn't working 😅 Out of curiosity, how did you figure out that module/version was the culprit?

kadirgun commented 2 weeks ago

@SSTPIERRE2

kadirgun commented 1 week ago

Related https://github.com/tabler/tabler-icons/issues/1233