Open webkong opened 1 month ago
Could you show how did you trigger this error?
just
import dts from "vite-plugin-dts";
plugins: [dts()]
tsconfig
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* declaration */
"declaration": true,
"declarationDir": "./types",
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
I've encountered the same exact experience as described by @webkong.
After messing with it and debugging for WAY tooo long, I finally discovered that I was setting
export default defineConfig({
build: {
rollupOptions: { plugins: [dts({ rollupTypes: true })] },
...
}
})
When I should have been setting
export default defineConfig({
plugins: [dts({ rollupTypes: true })],
build: {
...
},
});
Seems like it's always the little things that trip you up
Describe the bug
When I use dts according to documentation.
import dts from "vite-plugin-dts";
plugins: [dts()]
I'm try to fix the bug. Add a
?
can resove.Reproduction
no url
Steps to reproduce
No response
System Info
Validations