We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug esbuild-svelte started throwing errors after upgrading svelte-preprocess and TypeScript (I upgraded both for peer deps conflict)
$ node build.js ✘ [ERROR] Unexpected token [plugin esbuild-svelte] MyComponent.svelte:2:13: 2 │ 1: <script type="typescript"> ╵ ^ 2: import type { Foo } from './foo'; ^ 3: 4: const foo: Foo = 'bar'; The plugin "esbuild-svelte" was triggered by this import index.ts:1:24: 1 │ import MyComponent from './MyComponent.svelte'; ╵ ~~~~~~~~~~~~~~~~~~~~~~
To Reproduce
Run the build script where the followings are installed
package.json
{ "private": true, "dependencies": { "esbuild": "^0.17.16", "esbuild-svelte": "^0.7.3", "svelte": "^3.58.0", "svelte-preprocess": "^5.0.3", "typescript": "^5.0.4" } }
(I confirmed the lock file tells the save versions.)
build.js
const esbuild = require('esbuild'); const esbuildSvelte = require('esbuild-svelte'); const path = require('path'); const sveltePreprocess = require('svelte-preprocess'); esbuild .build({ entryPoints: [path.resolve(__dirname, './index.ts')], mainFields: ['svelte', 'browser', 'module', 'main'], bundle: true, outdir: path.resolve(__dirname, './dist'), plugins: [ esbuildSvelte({ preprocess: sveltePreprocess(), }), ], }) .catch(() => process.exit(1));
MyComponent.svelte
<script type="typescript"> import type { Foo } from './foo'; …
Expected behavior
Compile them as well as recent versions
Screenshots
N/A
Environment (please complete the following information):
Additional context
type
The text was updated successfully, but these errors were encountered:
Please note the svelte-preprocess release notes for version 5.0.0. The most relevant change is:
svelte-preprocess
5.0.0
Cannot use "type" attribute to identify the language of a style or script tag anymore. Use lang instead
Sorry, something went wrong.
Perfect. Thank you!
-<script type="typescript"> +<script lang="typescript">
No branches or pull requests
Describe the bug
esbuild-svelte started throwing errors after upgrading svelte-preprocess and TypeScript (I upgraded both for peer deps conflict)
To Reproduce
Run the build script where the followings are installed
package.json
(I confirmed the lock file tells the save versions.)
build.js
MyComponent.svelte
Expected behavior
Compile them as well as recent versions
Screenshots
N/A
Environment (please complete the following information):
Additional context
type
seems problematicThe text was updated successfully, but these errors were encountered: