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

Babel TypeScript transformer does not support satisfies operator #43799

Closed
1 task done
domosedov opened this issue Dec 7, 2022 · 15 comments · Fixed by #51962
Closed
1 task done

Babel TypeScript transformer does not support satisfies operator #43799

domosedov opened this issue Dec 7, 2022 · 15 comments · Fixed by #51962
Labels
bug Issue was opened via the bug report template. locked

Comments

@domosedov
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Wed Dec 07 2022 11:10:08 GMT+0300 (Москва, стандартное время)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.0.7-canary.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://stackblitz.com/edit/vercel-next-js-pa3kjy?file=pages%2Findex.tsx

To Reproduce

npm run dev

Describe the Bug

./pages/index.tsx:10:20
Syntax error: Missing semicolon.

   8 | }
   9 |
> 10 | const user = {id: 1} satisfies User

Expected Behavior

No error

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@domosedov domosedov added the bug Issue was opened via the bug report template. label Dec 7, 2022
@domosedov
Copy link
Author

Any news?

@oliviertassinari
Copy link
Contributor

The problem seems discussed in babel/babel#15157.

@domosedov
Copy link
Author

any news how to fix?

@oliviertassinari
Copy link
Contributor

oliviertassinari commented Feb 21, 2023

@domosedov Is it solved? Could you reopen if not?

@domosedov domosedov reopened this Feb 21, 2023
@jrolfs
Copy link

jrolfs commented Feb 24, 2023

I upgraded and ensured all of our @babel/* dependencies were deduplicated and on the proper versions, and I still was unable to get this to work with Next's Babel setup. I didn't have time to dig into it more, but it seems like the issue might be with the next/babel preset. For anyone else having trouble, you might have luck replacing that preset entirely with @babel/preset-typescript, etc. (after following some of the guidance in babel/babel#15157 to ensure you're on the correct version of @babel/*). For the record, I was on Next.js 12.3.4.

I ultimately realized I really didn't need the customizations our Babel configuration provided, and I ended up upgrading to Next.js 13.2.1 and removed our Babel configuration to switch to the SWC compiler. Everything is working great with that setup. If you're looking to do the same, keep in mind that you'll need to be on Next.js 13+ (satisfies support landed in the Next.js SWC toolchain in v13.0.5-canary.3). There might be a way to upgrade the SWC compiler independent of Next.js, but upgrading to 13 was pretty straightforward, so I didn't look into it.

@7iomka
Copy link
Contributor

7iomka commented Mar 8, 2023

@ jrolfs Unfortunately, I can't get rid of Babel as easily as you can.
Please tell me at the moment people have not found a way out of the situation?
I can not use satisfies because of this problem(

@omerchn
Copy link

omerchn commented May 29, 2023

did anyone manage to solve this? 🙏

@7iomka
Copy link
Contributor

7iomka commented May 29, 2023

did anyone manage to solve this? 🙏

Verсel seems to have no respect for users who still use the pages approach with babel configuration. 👎

@mfanuzzi
Copy link

mfanuzzi commented Sep 5, 2023

Well this sucks

@ASISBusiness
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:

  Platform: linux

  Arch: x64

  Version: Ubuntu 20.04.0 LTS Wed Dec 07 2022 11:10:08 GMT+0300 (Москва, стандартное время)

Binaries:

  Node: 16.14.2

  npm: 7.17.0

  Yarn: 1.22.19

  pnpm: 7.13.6

Relevant packages:

  next: 13.0.7-canary.1

  eslint-config-next: N/A

  react: 18.2.0

  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://stackblitz.com/edit/vercel-next-js-pa3kjy?file=pages%2Findex.tsx

To Reproduce

npm run dev

Describe the Bug


./pages/index.tsx:10:20

Syntax error: Missing semicolon.



   8 | }

   9 |

> 10 | const user = {id: 1} satisfies User

Expected Behavior

No error

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@OmkarK45
Copy link

Any updates on this issue? @domosedov were you able to find any workaround?

@domosedov
Copy link
Author

Any updates on this issue? @domosedov were you able to find any workaround?

No

@tebuevd
Copy link

tebuevd commented Oct 3, 2023

any updates on this? afaik Next maintainers just need to bump babel and this would work...

@7iomka
Copy link
Contributor

7iomka commented Oct 8, 2023

any updates on this? afaik Next maintainers just need to bump babel and this would work...

I'd like to know how to speed up this process.
It's as if they are purposely ignoring this request and anything to do with babel users

@kodiakhq kodiakhq bot closed this as completed in #51962 Oct 17, 2023
kodiakhq bot pushed a commit that referenced this issue Oct 17, 2023
### What?

Update Babel packages across the board

### Why?

Since you ship vendored presets and plugins it's impossible for people to update this stuff at their own pace - independently from Next. So users of `next/babel` are currently stuck with old versions and, for example, they might not be able to use the TS `satisfies` operator.

### How?

I just updated ranges (to pinned ones) where I could find them, run `corepack pnpm i` and re-run build scripts in the `packages/next`.

Fixes #43799
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants