With a brand new svelte-ts app created using create-vite, the tsconfig.json file shows an error at "references": [{ "path": "./tsconfig.node.json" }]: Referenced project '<path to app>/tsconfig.node.json' may not disable emit.ts
Possibly the correct setting is emitDeclarationOnly instead of noEmit (tsc maybe depends on the .d.ts files of the referenced project to split up the work, and noEmit prevents those from being created? As per this discussion). The error goes away with emitDeclarationOnly: true, but does that mean tsc is doing extra work that esbuild is already handling?
pnpm build and pnpm check succeed, it's just an annoying error (but maybe is indicative of some type checking actually not happening correctly?). Maybe it is actually a VSCode error?
Then open in VSCode, and look at tsconfig.json. It should have a red squiggle on line 20.
OR run npx tsc
If you change line 9 of tsconfig.node.json from "noEmit": true to "emitDeclarationOnly": true and save, the error goes away (but maybe this setting is undesirable?).
If I do everything again with npm, the result is the same.
NOTE: the error doesn't show in the editor in stackblitz using npm or pnpm, but it does if you run npx tsc!
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
With a brand new svelte-ts app created using
create-vite
, thetsconfig.json
file shows an error at"references": [{ "path": "./tsconfig.node.json" }]
:Referenced project '<path to app>/tsconfig.node.json' may not disable emit.ts
The change is relatively recent: https://github.com/vitejs/vite/commit/cf3f40cd383509fdb1294568fb38bacfac419ea1
Possibly the correct setting is emitDeclarationOnly instead of noEmit (tsc maybe depends on the
.d.ts
files of the referenced project to split up the work, andnoEmit
prevents those from being created? As per this discussion). The error goes away withemitDeclarationOnly: true
, but does that mean tsc is doing extra work that esbuild is already handling?pnpm build
andpnpm check
succeed, it's just an annoying error (but maybe is indicative of some type checking actually not happening correctly?). Maybe it is actually a VSCode error?Reproduction
https://stackblitz.com/edit/vitejs-vite-vrcca7?file=tsconfig.json
Steps to reproduce
Then open in VSCode, and look at
tsconfig.json
. It should have a red squiggle on line 20.OR run
npx tsc
If you change line 9 of
tsconfig.node.json
from"noEmit": true
to"emitDeclarationOnly": true
and save, the error goes away (but maybe this setting is undesirable?).If I do everything again with npm, the result is the same.
NOTE: the error doesn't show in the editor in stackblitz using npm or pnpm, but it does if you run
npx tsc
!System Info
Used Package Manager
pnpm
Logs
Click to expand!
```shell vite:config bundled config file loaded in 275.26ms +0ms vite:config using resolved config: { vite:config plugins: [ vite:config 'vite:build-metadata', vite:config 'vite:watch-package-data', vite:config 'vite:pre-alias', vite:config 'alias', vite:config 'vite-plugin-svelte', vite:config 'vite:modulepreload-polyfill', vite:config 'vite:resolve', vite:config 'vite:html-inline-proxy', vite:config 'vite:css', vite:config 'vite:esbuild', vite:config 'vite:json', vite:config 'vite:wasm-helper', vite:config 'vite:worker', vite:config 'vite:asset', vite:config 'vite:wasm-fallback', vite:config 'vite:define', vite:config 'vite:css-post', vite:config 'vite:build-html', vite:config 'vite:worker-import-meta-url', vite:config 'vite:asset-import-meta-url', vite:config 'vite:force-systemjs-wrap-complete', vite:config 'commonjs', vite:config 'vite:data-uri', vite:config 'vite:dynamic-import-vars', vite:config 'vite:import-glob', vite:config 'vite:build-import-analysis', vite:config 'vite:esbuild-transpile', vite:config 'vite:terser', vite:config 'vite:reporter', vite:config 'vite:load-fallback' vite:config ], vite:config build: { vite:config target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ], vite:config cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ], vite:config outDir: 'dist', vite:config assetsDir: 'assets', vite:config assetsInlineLimit: 4096, vite:config cssCodeSplit: true, vite:config sourcemap: false, vite:config rollupOptions: {}, vite:config minify: 'esbuild', vite:config terserOptions: {}, vite:config write: true, vite:config emptyOutDir: null, vite:config copyPublicDir: true, vite:config manifest: false, vite:config lib: false, vite:config ssr: false, vite:config ssrManifest: false, vite:config ssrEmitAssets: false, vite:config reportCompressedSize: true, vite:config chunkSizeWarningLimit: 500, vite:config watch: null, vite:config commonjsOptions: { include: [Array], extensions: [Array] }, vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }, vite:config modulePreload: { polyfill: true }, vite:config cssMinify: true vite:config }, vite:config resolve: { vite:config mainFields: [ 'svelte', 'browser', 'module', 'jsnext:main', 'jsnext' ], vite:config conditions: [ 'svelte' ], vite:config extensions: [ vite:config '.mjs', '.js', vite:config '.mts', '.ts', vite:config '.jsx', '.tsx', vite:config '.json' vite:config ], vite:config dedupe: [ vite:config 'svelte/animate', vite:config 'svelte/easing', vite:config 'svelte/internal', vite:config 'svelte/internal/disclose-version', vite:config 'svelte/motion', vite:config 'svelte/ssr', vite:config 'svelte/store', vite:config 'svelte/transition', vite:config 'svelte', vite:config 'svelte-hmr/runtime/hot-api-esm.js', vite:config 'svelte-hmr/runtime/proxy-adapter-dom.js', vite:config 'svelte-hmr' vite:config ], vite:config preserveSymlinks: false, vite:config alias: [ [Object], [Object] ] vite:config }, vite:config optimizeDeps: { vite:config holdUntilCrawlEnd: true, vite:config include: [ vite:config 'svelte/animate', vite:config 'svelte/easing', vite:config 'svelte/internal', vite:config 'svelte/internal/disclose-version', vite:config 'svelte/motion', vite:config 'svelte/store', vite:config 'svelte/transition', vite:config 'svelte' vite:config ], vite:config exclude: [ 'svelte-hmr' ], vite:config esbuildOptions: { preserveSymlinks: false } vite:config }, vite:config ssr: { vite:config target: 'node', vite:config external: [], vite:config noExternal: [ 'svelte', /^svelte\// ], vite:config optimizeDeps: { noDiscovery: true, esbuildOptions: [Object] } vite:config }, vite:config experimental: { importGlobRestoreExtension: false, hmrPartialAccept: true }, vite:config configFile: 'Validations