-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Next.js 12.0.8 breaks "this" in TS classes #33283
Labels
SWC
Related to minification/transpilation in Next.js.
Comments
ijjk
added
SWC
Related to minification/transpilation in Next.js.
kind: bug
and removed
bug
Issue was opened via the bug report template.
labels
Jan 13, 2022
kdy1
added a commit
to swc-project/swc
that referenced
this issue
Jan 14, 2022
swc_ecma_transforms_compat: - `async_to_generator`: Fix `this` in async class properties. (vercel/next.js#33283) - Add a test for #3228 (Closes #3228).
Merged
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
natew
pushed a commit
to natew/next.js
that referenced
this issue
Feb 16, 2022
This PR is a bit big because AST definitions are modified recently because previous AST defs were too error-prone. It will prevent plugin authors from making some common mistakes. - Closes vercel#33088 - Closes vercel#31084 - Closes vercel#33283
nevilm-lt
pushed a commit
to nevilm-lt/next.js
that referenced
this issue
Apr 22, 2022
This PR is a bit big because AST definitions are modified recently because previous AST defs were too error-prone. It will prevent plugin authors from making some common mistakes. - Closes vercel#33088 - Closes vercel#31084 - Closes vercel#33283
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Run
next info
(available from version 12.0.8 and up)Operating System:
Platform: linux
Arch: x64
Version: #51~20.04.1-Ubuntu SMP Fri Jan 7 06:51:40 UTC 2022
Binaries:
Node: 16.13.2
npm: 8.0.0
Yarn: 1.22.17
pnpm: N/A
Relevant packages:
next: 12.0.8
react: 17.0.2
react-dom: 17.0.2
What version of Next.js are you using?
12.0.8
What version of Node.js are you using?
16.13.2
What browser are you using?
Chrome, Safari, Firefox
What operating system are you using?
Android, IOS, macOS, Windows, Linux
How are you deploying your application?
Vercel
Describe the Bug
After upgrading Next.js from 12.0.7 to 12.0.8, an important system broke at our company.
TypeScript code that had classes like the example below broke, because
this
becameundefined
.(check out "To Reproduce" section)
Expected Behavior
I would expect
this
in a method to actually refer to the instance of the class and not beundefined
.(as also specified in TS docs)
This code has been in the codebase for quite a while and has survived major Next.js releases, until this minor one :)
To Reproduce
The text was updated successfully, but these errors were encountered: