-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
TypeScript Target Compiler Option is Silently Ignored #37271
Comments
Feel free to open a PR to add a warning. |
Thanks for the quick reply! Is there another way to configure what JavaScript features the compiler considers as available? Perhaps the warning message could redirect people to that? |
Faced this issue recently. I agree that adding a warning would be a good idea for now. |
Hi everyone! Please feel free to share any thoughts on the linked PR i just pushed. #43582 |
There is [some confusion](https://twitter.com/samselikoff/status/1608840153963057152) over why `"target": "es5"` is in `tsconfig.json` and whether or not it should be changed. The `target` property is not used by Next.js, so this PR removes it. - Closes: #37271 - Closes: #43582
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
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 16.13.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.7-canary.19
react: 18.1.0
react-dom: 18.1.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next export
Describe the Bug
Changing the
tsconfig.json
->compilerOptions
->target
setting has no effect on static export builds and no error or warning occurs to indicate this.This is my first time filing a bug report, so please let me know if I'm doing anything wrong or unhelpful!
Expected Behavior
Changing the TypeScript build target should be respected by the build engine like other TypeScript configuration settings, or an error or warning should indicate that the TypeScript target must always be a certain value.
To Reproduce
npx create-next-app@canary --typescript
build
script inpackage.json
to benext build && next export
Image
import andImage
tag fromindex.tsx
because it will prevent static build from succeedingpages/_app.tsx
with a trivial piece of functionality which uses anES2022
featurecompilerOptions
->target
intsconfig.json
to beES2022
npm run build
_app-<cache-bust>.js
inout/_next/static/chunks/pages
that the private field#forMeOnly
is enforced usingWeakMap
and not using the native JavaScript feature fromES2022
#forMeOnly
(or a minified version) and noWeakMap
The text was updated successfully, but these errors were encountered: