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

macOs 'Internal Error: Unable to follow symbol for "Record"' when rollupTypes set to true. #399

Open
benoitlahoz opened this issue Nov 28, 2024 · 9 comments
Labels
upstream Something about upstream packages

Comments

@benoitlahoz
Copy link

benoitlahoz commented Nov 28, 2024

Thank you for this plugin.

Like in this issue, suddenly I have this error.

I can't provide a reproduction link as this is a pretty complex library code. But, like in the mentioned issue, it disappears when rollupTypes: false.

Note that I use swc to compile.

I am on:

  • macOs 12.7.3
  • node 20.15.0
  • vite 5.4.6
  • vite-plugin-dts 4.2.3
  • rollup-plugin-swc 0.2.1

Thank you.

@smoooty
Copy link

smoooty commented Dec 3, 2024

I ran into the same issue.

I noticed there is a FAQ about it, https://github.com/qmhc/vite-plugin-dts?tab=readme-ov-file#internal-error-occurs-when-using-rolluptypes-true, indicating it is a limitation of the @microsoft/api-extractor.

In my case I was able to resolve the issue by correcting the import to be more exact.

@lawvs
Copy link

lawvs commented Dec 3, 2024

I also encountered this issue when the typescript was upgraded from 5.6.3 to 5.7.2 in lawvs/zod-compare#42, and I did not specify baseUrl in tsconfig.json.

  plugins: [
    dts({
      rollupTypes: true,
      include: ["src/**/*.ts", "src/**/*.d.ts"],
      exclude: ["src/**/__tests__/*"],
    }),
  ],

@Brain777777
Copy link

I also encountered the same issue After I downgraded TypeScript to 5.4.2 the error disappeared

@brc-dd
Copy link

brc-dd commented Dec 20, 2024

For me it was because of ts version mismatch between api-extractor and local package.json. You can force override it and it works fine:

  "pnpm": {
    "overrides": {
      "typescript": "^5.7.2"
    }
  }

@benoitlahoz
Copy link
Author

Thank you @brc-dd, that works!

@mkrause
Copy link

mkrause commented Jan 7, 2025

Still getting issues even with the override. There's open PR here to upgrade @microsoft/api-extractor, once that's fixed hopefully vite-plugin-dts can be updated to support TS 5.7 too.

microsoft/rushstack#4815

@mkrause
Copy link

mkrause commented Jan 7, 2025

New release of @microsoft/api-extractor is out with TS 5.7 support: https://github.com/microsoft/rushstack/blob/main/apps/api-extractor/CHANGELOG.md#7490

@benoitlahoz
Copy link
Author

For now I resolved the problem by removing typescript from 'devDependemcies' and changing my VSCode typescript settings. Even if both typescript versions were the same, well... it worked...

@qmhc qmhc added the upstream Something about upstream packages label Jan 10, 2025
@mkrause
Copy link

mkrause commented Jan 10, 2025

Upgraded to vite-plugin-dts v4.5.0 which uses the latest @microsoft/api-extractor. I'm no longer getting the warnings about TypeScript version mismatch. However, the issue still occurs:

Analysis will use the bundled TypeScript version 5.7.2
x Build failed in 4.99s
error during build:
[vite:dts] Internal Error: Unable to follow symbol for "TooltipProvider"

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
    at AstSymbolTable._analyzeChildTree (/Users/mkrause/data/projects/fortanix/wd_baklava2/wd/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:328:43)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Something about upstream packages
Projects
None yet
Development

No branches or pull requests

7 participants