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

Internal server error: unknown variant ESNext #93

Open
5 tasks done
KiddoV opened this issue Jan 17, 2024 · 2 comments
Open
5 tasks done

Internal server error: unknown variant ESNext #93

KiddoV opened this issue Jan 17, 2024 · 2 comments

Comments

@KiddoV
Copy link

KiddoV commented Jan 17, 2024

Describe the bug

When you set your compilerOptions.target: "ESNext" in tsconfig.ts file. This will throw an error:

6:30:56 AM [vite] Internal server error: unknown variant `ESNext`, expected one of `es3`, `es5`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020`, `es2021`, `es2022`, `esnext` at line 1 column 241
  Plugin: swc
  File: .../src/main.ts

6:30:56 AM [vite] Pre-transform error: unknown variant `ESNext`, expected one of `es3`, `es5`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020`, `es2021`, `es2022`, `esnext` at line 1 column 241

My vite.config.ts

import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import sveltePreprocess from 'svelte-preprocess';
import swc from 'unplugin-swc';

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		swc.vite(),
		svelte({
			preprocess: sveltePreprocess({
				// Enable strict prop checking
				strictProps: false,
			}),
		}),
	],
})

I am expecting "ESNext" and "esnext" should be the same.

Reproduction

https://stackblitz.com/edit/vitejs-vite-43qo9n?file=vite.config.ts

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
    Memory: 7.59 GB / 31.89 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.77)
    Internet Explorer: 11.0.19041.3636

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Copy link

stackblitz bot commented Jan 17, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Jerome1337
Copy link

Any info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants