You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I verified that the issue exists in Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
Binaries:
Node: 16.14.0
npm: 8.3.1
Yarn: 1.22.17
pnpm: N/A
Relevant packages:
next: 12.1.4
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
A version of useSubscription interned/vendored into Next (#35746) because of its new peer-dep declaration. This version contains an arrow function which is not ES5-compatible.
Expected Behavior
Next currently states that it is ES5 compatible, so it should not contain this arrow function. #33227
I've also created #35913 to try to prevent these situations in the future.
To Reproduce
Create a next app (e.g. npx create-next-app@latest)
Add a dynamic import (the code-path that contains internal useSubscription usage). For example, change pages/index.js to dynamically import the Image component:
import Head from 'next/head';
import styles from '../styles/Home.module.css';
import dynamic from 'next/dynamic';
const Image = dynamic(() => import('next/image'));
Run next build
Run npx es-check es5 '.next/static/**/*.js'
Get error:
error: ES-Check: there were 1 ES version matching errors.
info:
ES-Check Error:
----
· erroring file: .next/static/chunks/pages/index-35bd0f2403564f83.js
· error: SyntaxError: Unexpected token (1:8374)
· see the printed err.stack below for context
----
SyntaxError: Unexpected token (1:8374)
The text was updated successfully, but these errors were encountered:
So we don't regress on issues like #39090, #35913, #34629, #33314, etc.
Closes#35912
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`
## Documentation / Examples
- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
A version of
useSubscription
interned/vendored into Next (#35746) because of its new peer-dep declaration. This version contains an arrow function which is not ES5-compatible.Expected Behavior
Next currently states that it is ES5 compatible, so it should not contain this arrow function. #33227
I've also created #35913 to try to prevent these situations in the future.
To Reproduce
npx create-next-app@latest
)useSubscription
usage). For example, changepages/index.js
to dynamically import the Image component:next build
npx es-check es5 '.next/static/**/*.js'
Get error:
The text was updated successfully, but these errors were encountered: