8000 feat: implement object tree-shaking by TrickyPi · Pull Request #5420 · rollup/rollup · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: implement object tree-shaking #5420

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

Merged
merged 59 commits into from
Nov 15, 2024
Merged

Conversation

TrickyPi
Copy link
Member
@TrickyPi TrickyPi commented Mar 8, 2024

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

related #5410

Description

Please see the comments in this PR.

Copy link
vercel bot commented Mar 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 5:53am

Copy link
github-actions bot commented Mar 8, 2024

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#feat/tree-shaking-5410

Notice: Ensure you have installed the latest stable Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-iom75ibri-rollup-js.vercel.app/repl/?pr=5420

Copy link
codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 97.52475% with 10 lines in your changes missing coverage. Please review.

Project coverage is 98.89%. Comparing base (ae1d14b) to head (81f5021).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/ast/nodes/MemberExpression.ts 77.77% 4 Missing ⚠️
src/ast/nodes/RestElement.ts 80.00% 0 Missing and 2 partials ⚠️
src/ast/nodes/ArrayPattern.ts 93.33% 0 Missing and 1 partial ⚠️
src/ast/nodes/Property.ts 93.33% 0 Missing and 1 partial ⚠️
src/ast/nodes/TaggedTemplateExpression.ts 83.33% 1 Missing ⚠️
src/ast/nodes/VariableDeclaration.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5420      +/-   ##
==========================================
- Coverage   99.00%   98.89%   -0.12%     
==========================================
  Files         258      258              
  Lines        8070     8204     +134     
  Branches     1360     1387      +27     
==========================================
+ Hits         7990     8113     +123     
- Misses         53       60       +7     
- Partials       27       31       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member
@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Thank you for picking this up! This already works quite well in many cases, but I found a few issues that should be resolved before we merge this. See this example

https://rollup-ciqghdigc-rollup-js.vercel.app/repl/?pr=5420&shareable=JTdCJTIyZXhhbXBsZSUyMiUzQW51bGwlMkMlMjJtb2R1bGVzJTIyJTNBJTVCJTdCJTIyY29kZSUyMiUzQSUyMmNvbnN0JTIwbW9kdWxlJTIwJTNEJTIwYXdhaXQlMjBpbXBvcnQoJy4lMkZtb2R1bGUnKSUzQiU1Q24lMkYlMkYlMjBJZiUyMHdlJTIwYWNjZXNzJTIwb25lJTIwZmllbGQlMjBkaXJlY3RseSUyQyUyMGl0JTIwZG9lcyUyMG5vdCUyMHRyYWNrJTIwb3RoZXIlMjB3YXlzJTIwb2YlMjBhY2Nlc3NpbmclMjBwcm9wZXJ0aWVzJTVDbm1vZHVsZS5mb28oKSUzQiU1Q24lNUNuJTJGJTJGJTIwbGlrZSUyMHVzaW5nJTIwYW4lMjAlNUMlMjJ1bmtub3duJTVDJTIyJTIwdmFsdWUlNUNubW9kdWxlJTVCZ2xvYmFsVGhpcy50aGlzTWlnaHRCZUJhciU1RCgpJTNCJTVDbiU1Q24lMkYlMkYlMjBwYXNzaW5nJTIwaXQlMjB0byUyMGElMjBmdW5jdGlvbiU1Q25yZWFkQmFyKG1vZHVsZSklM0IlNUNuZnVuY3Rpb24lMjByZWFkQmFyKG1vZHVsZSklMjAlN0IlNUNuJTIwJTIwbW9kdWxlLmJhcigpJTVDbiU3RCU1Q24lNUNuJTJGJTJGJTIwYXNzaWduaW5nJTIwaXQlMjB0byUyMGFub3RoZXIlMjB2YXJpYWJsZSU1Q25jb25zdCUyMG1vZHVsZUNvcHklMjAlM0QlMjBtb2R1bGUlM0IlNUNubW9kdWxlQ29weS5iYXIoKSUzQiU1Q24lNUNuJTJGJTJGJTIwZGVzdHJ1Y3R1cmluZyU1Q25jb25zdCUyMCU3QiUyMGJhciUyMCU3RCUyMCUzRCUyMG1vZHVsZSUzQiU1Q25iYXIoKSUzQiU1Q24lNUNuJTJGJTJGJTIwdXNpbmclMjBpdCUyMGluJTIwYSUyMHNlcXVlbmNlJTIwZXhwcmVzc2lvbiU1Q24oJ2ZvbyclMkMlMjBtb2R1bGUpLmJhcigpJTNCJTVDbiU1Q24lMkYlMkYlMjB1c2luZyUyMGl0JTIwaW4lMjBhJTIwY29uZGl0aW9uYWwlMjBleHByZXNzaW9uJTVDbih0cnVlJTIwJTNGJTIwbW9kdWxlJTIwJTNBJTIwJ2ZvbycpLmJhcigpJTNCJTVDbiU1Q24lMkYlMkYlMjB1c2luZyUyMGl0JTIwaW4lMjBhJTIwbG9naWNhbCUyMGV4cHJlc3Npb24lNUNuKHRydWUlMjAlMjYlMjYlMjBtb2R1bGUpLmJhcigpJTNCJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlMkMlMjJuYW1lJTIyJTNBJTIybWFpbi5qcyUyMiU3RCUyQyU3QiUyMmNvZGUlMjIlM0ElMjJleHBvcnQlMjBjb25zdCUyMGZvbyUyMCUzRCUyMCgpJTIwJTNEJTNFJTIwY29uc29sZS5sb2coJ2ZvbycpJTNCJTVDbmV4cG9ydCUyMGNvbnN0JTIwYmFyJTIwJTNEJTIwKCklMjAlM0QlM0UlMjBjb25zb2xlLmxvZygnYmFyJyklM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBZmFsc2UlMkMlMjJuYW1lJTIyJTNBJTIybW9kdWxlLmpzJTIyJTdEJTVEJTJDJTIyb3B0aW9ucyUyMiUzQSU3QiUyMm91dHB1dCUyMiUzQSU3QiUyMmZvcm1hdCUyMiUzQSUyMmVzJTIyJTdEJTJDJTIydHJlZXNoYWtlJTIyJTNBdHJ1ZSU3RCU3RA==

Basically at the moment if you access some properties of the namespace by name, it will ignore all indirect property accesses, which include

  • via unknown/ 8000 statically not resolvable computed properties
  • via destructuring
  • via passing the namespace to a function
  • via assigning it to another variable
  • via accessing it through a sequence, conditional or logical expression

Not sure if this list is complete. In all of these cases, one should probably include all exports. On the other hand if we can handle all of those cases, there is no reason to include any exports by default if the namespace is not accessed at all.

The question is how to do this elegantly. One way of addressing this could be to try to handle all edge cases. Another could be to try to implement the bigger feature of object property tree-shaking.

To do that, one could basically replace the current include method with an includePath(path, context, includeChildrenRecursively, options) method. By default, this would still include the whole object of which we access a single path here


However, we can override the method in some strategic locations. I.e. if we include a path ['foo'] of a member expression bar.baz, instead it includes the path ['baz', 'foo'] of bar . We can also shorten paths to prevent some circularity issues here as it is never a problem to include "too much", especially if some path segments are unknown.

@lukastaegert
Copy link
Member

That being said, I would really like to encourage you to do this. This could become a feature I literally wanted to implement for years. Basically what you need to do is

  • replace include(...) with includePath(EMPTY_PATH, ...) everywhere
  • use something better than EMPTY_PATH where it makes sense (e.g. in MemberExpression), but do not try to overdo this for the first release to not extend the scope of the feature too much
  • Add special handling for includePath in ImportExpression so that it only includes all fields if it does not receive a specific field.

In another step, we could add special handling to ObjectExpression so that we can start tree-shaking for objects, but I fear there might be implications and edge cases to consider, so starting with ImportExpression would be nice.

One question is what to do with destructuring. At the moment, destructuring will not be able to track paths, which is something you also see when tracking values like here https://rollup-ciqghdigc-rollup-js.vercel.app/repl/?pr=5420&shareable=JTdCJTIyZXhhbXBsZSUyMiUzQW51bGwlMkMlMjJtb2R1bGVzJTIyJTNBJTVCJTdCJTIyY29kZSUyMiUzQSUyMmNvbnN0JTIwb2JqJTIwJTNEJTIwJTdCZm9vJTNBJTIwdHJ1ZSUyQyUyMGJhciUzQSUyMGZhbHNlJTdEJTNCJTVDbmlmJTIwKG9iai5iYXIpJTIwY29uc29sZS5sb2coJ3JlbW92ZWQnKSUzQiU1Q24lNUNuY29uc3QlMjAlN0JiYXIlN0QlMjAlM0QlMjBvYmolM0IlNUNuaWYlMjAoYmFyKSUyMGNvbnNvbGUubG9nKCdub3QlMjByZW1vdmVkJTIwZXZlbiUyMHRob3VnaCUyMGl0JTIwc2hvdWxkJTIwYmUnKSUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTJDJTIybmFtZSUyMiUzQSUyMm1haW4uanMlMjIlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyb3V0cHV0JTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlN0QlMkMlMjJ0cmVlc2hha2UlMjIlM0F0cnVlJTdEJTdE

But again, this could be a separate improvement.

@TrickyPi
Copy link
Member Author
TrickyPi commented Mar 11, 2024

Wow, thank you so much for your professional and patient guidance! I will thoroughly digest this knowledge (object property tree-shaking) and then work on implementing it.

@lukastaegert
Copy link
Member

My pleasure! You are doing great work and it turns out sharing knowledge and ideas with you is always a good investment 😉

@TrickyPi TrickyPi marked this pull request as draft March 14, 2024 02:10
@TrickyPi TrickyPi force-pushed the feat/tree-shaking-5410 branch from 2f541ee to eda5b5a Compare March 14, 2024 06:24
@TrickyPi TrickyPi force-pushed the feat/tree-shaking-5410 branch from eda5b5a to 080b10f Compare March 14, 2024 06:32
@TrickyPi TrickyPi force-pushed the feat/tree-shaking-5410 branch from 40f1b43 to c6c2366 Compare March 17, 2024 11:39
@TrickyPi TrickyPi force-pushed the feat/tree-shaking-5410 branch from c6c2366 to adf93ab Compare March 17, 2024 11:46
@TrickyPi TrickyPi force-pushed the feat/tree-shaking-5410 branch from 65a67f3 to 4f938e3 Compare March 20, 2024 06:23
@TrickyPi TrickyPi marked this pull request as ready for review March 24, 2024 14:31
Copy link

This PR has been released as part of rollup@4.27.0-1. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.27.0-1 or npm install rollup@beta. It will likely become part of a regular release later.

@sapphi-red
Copy link
Contributor

Thanks! I tried it out and the tests in Vite repo now passes 👍

@lukastaegert lukastaegert merged commit a9acb57 into master Nov 15, 2024
72 of 74 checks passed
@lukastaegert lukastaegert deleted the feat/tree-shaking-5410 branch November 15, 2024 05:35
Copy link

This PR has been released as part of rollup@4.27.0. You can test it via npm install rollup.

@jaskp
Copy link
jaskp commented Nov 15, 2024

Would it be feasible to make this configurable? In my large Vite project (with big JSONs, which could be the culprit), it increases memory usage a lot, to the point of OOM (which doesn't happen with 4.26.0), so I'd like to turn it off in config

@lukastaegert
Copy link
Member
lukastaegert commented Nov 15, 2024

Unfortunately, that is not really possible as there is a big architecture change behind it that cannot just be toggled, so while we could easily turn off the tree-shaking effects, it is much harder to fix the memory consumption.
While I work on improving this for the long term, this is not easy and will take more time. So far, the solution is usually to tweak the memory allocated to Node, cf. here https://rollupjs.org/troubleshooting/#error-javascript-heap-out-of-memory. This will work the same for Vite. Alternatively, you can set the environment variable

// On Windows, use "set" instead of "export"
export NODE_OPTIONS=--max-old-space-size=8192

to whatever is necessary to fix this.

Can you give an estimate how much memory consumption changes? In our own benchmark, it only changed by a few percentage points #5420 (comment), so it would be good to know if there is something obvious we missed.

@jaskp
Copy link
jaskp commented Nov 15, 2024

Understood, I was suprised myself given your benchmarks.

I tried to search for the lowest max-old-space-size (trial and error) that still allows Node to finish the build for my app (consisting of ~28000 modules). I actually wasn't able to get the build to finish at all with 4.27

Rollup Vite max old space size built
4.26.0 6.0.0-beta.10 6 144 MB ❌ (OOM after 3m 20s)
4.26.0 6.0.0-beta.10 6 656 MB ✅ 3m 46s
4.26.0 6.0.0-beta.10 7 168 MB ✅ 2m 44s
4.27.0 6.0.0-beta.10 8 192 MB ❌ (OOM after 5m)
4.27.0 6.0.0-beta.10 9 216 MB ❌ (OOM after 5m 30s)
4.27.0 6.0.0-beta.10 10 240 MB ❌ (OOM after 6m)
4.27.0 6.0.0-beta.10 15 360 MB ❌ (OOM after 24m)

Note: I'm building with sourcemaps for Sentry.

The OOM happens before chunks start getting rendered. Also, from a certain point, the memory usage increases very slowly until reaching the limit.

@lukastaegert
Copy link
Member

Ok, that actually looks like a bug. Especially if it does not complete. I assume this is a private project that cannot be shared, and it is not possible to provide some kind of reproduction?

@jaskp
Copy link
jaskp commented Nov 15, 2024

Yes, it cannot be shared. I can try to come up with some reproduction over the weekend, but unfortunately I cannot guarantee it. But in case somebody else wants to give it a shot, I'd try bundling a project that imports this package, but even that might not be enough, as it's smaller.

@lukastaegert
Copy link
Member

Ok, I found one small thing that I overlooked that might cause this. Can you give rollup@4.27.1-0 a shot and see if it improves anything?

@jaskp
Copy link
jaskp commented Nov 15, 2024

Hm, now vite:esbuild-transpile (which seems to run after Rollup transforms modules) is reporting these errors

ERROR: The symbol "be" has already been declared
ERROR: The symbol "Ve" has already been declared
ERROR: The symbol "q" has already been declared
ERROR: The symbol "dt" has already been declared
ERROR: The symbol "Gt" has already been declared

Maybe similar to this?

@jaskp
Copy link
jaskp commented Nov 15, 2024

But the error happens after the point where Rollup OOM'd previously, so it might be a step in the right direction.

@lukastaegert
Copy link
Member
lukastaegert commented Nov 15, 2024

Nice, it definitely is! I wonder if there is any chance we can figure out what the duplicate declarations look like. We would need to see the code of an erroring chunk before it is processed by esbuild.
If there is no obvious way, you can try a plugin like this in your Vite config:

export default defineConfig({
  plugins: [
    // should be the first plugin
    {
      name: 'debug-chunks',
      enforce: 'pre',
      renderChunk(code) {
        console.log('\n\n---CHUNK START---\n', code);
      }
    },
    // ... other plugins
  ]
  //...
})

Then have a look at the last chunk(s) printed before the error occurs.

At the moment, I am still struggling to find any hint what might be overlooked here. It would be enough to just see the two lines where the same variable is declared twice. Then I hopefully can limit my search a little bit, e.g. if I know if one of the declarations is in a destructuring, or in a parameter.

@lukastaegert
Copy link
Member

In any case, I will release the fixes I have so far.

@YoSev
Copy link
YoSev commented Nov 15, 2024

I can confirm that rollup 4.27.0 made it into my (small) nuxt project and prevents it from building due to a node memory-leak.
Not sure if this helps you:

<--- Last few GCs --->

[24372:0x148008000]   108868 ms: Mark-Compact 4017.2 (4132.3) -> 4002.0 (4133.0) MB, 574.71 / 0.00 ms  (average mu = 0.134, current mu = 0.010) allocation failure; scavenge might not succeed
[24372:0x148008000]   109432 ms: Mark-Compact 4018.0 (4133.0) -> 4002.7 (4133.5) MB, 558.75 / 0.00 ms  (average mu = 0.077, current mu = 0.009) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0x1023910e8 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
2: 0x102517120 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
3: 0x1026eb668 v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
4: 0x1026ef51c v8::internal::Heap::CollectGarbageShared(v8::internal::LocalHeap*, v8::internal::GarbageCollectionReason) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
5: 0x1026ebf80 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
6: 0x1026e9d08 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
7: 0x1026e095c v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
8: 0x1026e11bc v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
9: 0x1026c622c v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
10: 0x102aadcf4 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
11: 0x102e0cc44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
12: 0x102d868a8 Builtins_GrowFastSmiOrObjectElements [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
13: 0x108df5ebc 
14: 0x10861d78c 
15: 0x108be1364 
16: 0x10861dc94 
17: 0x10861e040 
18: 0x10861e040 
19: 0x10861e040 
20: 0x10861e040 
21: 0x10861e040 
22: 0x10861e040 
23: 0x10861e040 
24: 0x10861e040 
25: 0x10861e040 
26: 0x10861e040 
27: 0x10861e040 
28: 0x10861e040 
29: 0x10861e040 
30: 0x10861e040 
31: 0x10861e040 
32: 0x10861e040 
33: 0x10861e040 
34: 0x10861e040 
35: 0x10861e040 
36: 0x10861e040 
37: 0x10861e040 
38: 0x10861e040 
39: 0x10885f190 
40: 0x1091737e0 
41: 0x10928b200 
42: 0x1092aacf0 
43: 0x108649c0c 
44: 0x10926bbe8 
45: 0x108df6b20 
46: 0x108654d24 
47: 0x1092b363c 
48: 0x108df6c94 
49: 0x108654d24 
50: 0x1092b363c 
51: 0x108851dc4 
52: 0x10929d770 
53: 0x108e1a81c 
54: 0x102d843e4 Builtins_InterpreterEntryTrampoline [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
55: 0x102dbb210 Builtins_AsyncFunctionAwaitResolveClosure [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
56: 0x102e68fb8 Builtins_PromiseFulfillReactionJob [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
57: 0x102daab94 Builtins_RunMicrotasks [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
58: 0x102d823f4 Builtins_JSRunMicrotasksEntry [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
59: 0x102658ae8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
60: 0x102658fd4 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
61: 0x1026591b0 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
62: 0x10268037c v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
63: 0x102680b18 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
64: 0x1022b4c4c node::InternalCallbackScope::Close() [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
65: 0x1022b4774 node::CallbackScope::~CallbackScope() [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
66: 0x102354ec0 (anonymous namespace)::uvimpl::Work::AfterThreadPoolWork(int) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
67: 0x1023552a4 node::ThreadPoolWork::ScheduleWork()::'lambda'(uv_work_s*, int)::operator()(uv_work_s*, int) const [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
68: 0x102d5e824 uv__work_done [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
69: 0x102d62274 uv__async_io [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
70: 0x102d7434c uv__io_poll [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
71: 0x102d62838 uv_run [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
72: 0x1022b56f0 node::SpinEventLoopInternal(node::Environment*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
73: 0x1023d09e4 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
74: 0x1023d0764 node::NodeMainInstance::Run() [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
75: 0x10234fd58 node::Start(int, char**) [/Users/whoami/.nvm/versions/node/v20.12.2/bin/node]
76: 0x19b09c274 start [/usr/lib/dyld]

@lukastaegert
Copy link
Member

Try 4.27.1

@lukastaegert
Copy link
Member
lukastaegert commented Nov 15, 2024

@jaskp After all, I did find a few more potential sources of variable conflicts. Will release another fix shortly, see #5728.

@YoSev
Copy link
YoSev commented Nov 15, 2024

4.27.1

4.27.1 fixes the issue. Thank you.

@lukastaegert
Copy link
Member

4.27.2 fixes some deconflicting issues

@jaskp
Copy link
jaskp commented Nov 15, 2024

@lukastaegert I will take a look as soon as I can, probably in a few hours. Btw I wasn't able to easily extract the problematic chunk from Vite yet, not even with your plugin

@ijessen-mitll
Copy link

Just came here to say - I spent a chunk of my late morning chasing this exact build failure and I'm ashamed I'm so late (3 hrs lol) to the party. Thanks for the quick fix!

@lukastaegert
Copy link
Member

Past experience shows that for such a big feature you can only find so much with thorough testing and beta users. So best thing to release on a day where I know I will find time for quick bug fixes. Thank you all for your patience, hope we are good for the weekend now.

@jaskp
Copy link
jaskp commented Nov 16, 2024

4.27.2 fixes both OOM and variable conflicts! But I'll have to play around with it a bit more to see if the build time is unaffected. Either way thanks Lukas

lukastaegert added a commit that referenced this pull request Nov 18, 2024
lukastaegert added a commit that referenced this pull request Nov 18, 2024
…ed (#5736)

Revert "feat: implement object tree-shaking (#5420)"

This reverts commit a9acb57.
@lukastaegert lukastaegert mentioned this pull request Nov 18, 2024
9 tasks
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

Successfully merging this pull request may close these issues.

7 participants
0