Invoking a superclass' constructor doesn't work with Turbopack! #77467
Labels
linear: turbopack
Confirmed issue that is tracked by the Turbopack team.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/johansunden/my-app
To Reproduce
I have some JavaScript (well, TypeScript) that behaves differently depending on whether I start my app using Turbopack or Webpack. How this makes any sense I don't know.
I have a class
PasswordSignInRequest
that extends another classSignInRequest
. In the constructor ofPasswordSignInRequest
the constructor ofSignInRequest
is invoked usingsuper
. The constructor ofSignInRequest
mutatesthis
. Once the constructor ofSignInRequest
has been invoked,this
in the constructor ofPasswordSignInRequest
has been mutated if I have started my app using Webpack.Current vs. Expected behavior
Current behavior
If I start my app using Turbopack
this
in the constructor ofPasswordSignInRequest
has not been mutated once the constructor ofSignInRequest
has been invoked.Expected behavior
I would expect no difference in how
this
is mutated through the use ofsuper
when I start my app using Turbopack compared to Webpack. I would expectthis
in the constructor ofPasswordSignInRequest
to have been mutated!Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.2.0: Fri Dec 6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000 Available memory (MB): 32768 Available CPU cores: 10 Binaries: Node: 22.11.0 npm: 11.2.0 Yarn: N/A pnpm: N/A Relevant Packages: next: 15.2.3 // Latest available version is detected (15.2.3). eslint-config-next: 15.2.3 react: 18.3.1 react-dom: 18.3.1 typescript: 5.8.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: