vite-plugin-dts
vite-plugin-dts copied to clipboard
RangeError: Maximum call stack size exceeded
Building using the plugin runs into the following issue:
[vite:dts] Start generate declaration files...
error during build:
RangeError: Maximum call stack size exceeded
at node_modules/@ts-morph/common/dist/typescript.js:51333:53
at Object.trackSymbol (node_modules/@ts-morph/common/dist/typescript.js:51333:53)
at lookupSymbolChain (node_modules/@ts-morph/common/dist/typescript.js:52311:33)
at symbolToTypeNode (node_modules/@ts-morph/common/dist/typescript.js:52490:29)
at typeReferenceToTypeNode (node_modules/@ts-morph/common/dist/typescript.js:51868:40)
at typeToTypeNodeHelper (node_modules/@ts-morph/common/dist/typescript.js:51503:95)
at serializeReturnTypeForSignature (node_modules/@ts-morph/common/dist/typescript.js:52804:24)
at signatureToSignatureDeclarationHelper /node_modules/@ts-morph/common/dist/typescript.js:52193:42)
at createTypeNodesFromResolvedType (node_modules/@ts-morph/common/dist/typescript.js:51938:43)
at createTypeNodeFromObjectType (node_modules/@ts-morph/common/dist/typescript.js:51779:35)
My config is this:
export default defineConfig({
plugins: [
react(),
dts({
skipDiagnostics: false,
logDiagnostics: true,
})
],
build: {
sourcemap: true,
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "project",
fileName: "project",
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: "./src/setupTests.ts",
threads: false,
},
});
I should mention that the plugin fails with any options and that the project is sizeable (the plugin actually runs correctly when the number of components that are transpiled is reduced.
How about turn off the source map:
dts({
compilerOptions: {
sourceMap: false
}
})
Same error, unfortunately
Same error
Thanks a lot @qmhc
same error here.
With :
dts({
entryRoot: path.resolve(__dirname, 'src'),
compilerOptions: {
sourceMap: false
}
}),
I use Component Element and Chart.js in my lib, so it's big.
Same here in a Preact application.