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

RangeError: Maximum call stack size exceeded #97

Closed
Gungy2 opened this issue Aug 4, 2022 · 6 comments
Closed

RangeError: Maximum call stack size exceeded #97

Gungy2 opened this issue Aug 4, 2022 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@Gungy2
Copy link

Gungy2 commented Aug 4, 2022

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.

@qmhc
Copy link
Owner

qmhc commented Aug 6, 2022

How about turn off the source map:

dts({
  compilerOptions: {
    sourceMap: false
  }
})

@Gungy2
Copy link
Author

Gungy2 commented Aug 6, 2022

Same error, unfortunately

@hzx829
Copy link

hzx829 commented Sep 1, 2022

Same error

@qmhc qmhc added the help wanted Extra attention is needed label Sep 11, 2022
@qmhc qmhc closed this as completed in aea8ebd Nov 14, 2022
@Gungy2
Copy link
Author

Gungy2 commented Nov 14, 2022

Thanks a lot @qmhc

@hugo-valcourt
Copy link

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.

@AliBayatMokhtari
Copy link

Same here in a Preact application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants