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

The match result of alias from paths in tsconfig.json is out of bounds #298

Closed
3 tasks done
antoniosZ opened this issue Jan 18, 2024 · 4 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@antoniosZ
Copy link

Describe the bug

with 3.7.0 I have no issues.

As soon as I update to 3.7.1 and try to build the project, I get the following error:

[vite:dts] Start generate declaration files...
dist/index.js  161.03 kB │ gzip: 43.61 kB │ map: 503.88 kB
[vite:dts] Start rollup declaration files...
Analysis will use the bundled TypeScript version 5.3.3
[vite:dts] Maximum call stack size exceeded
✓ built in 6.31s
error during build:
RangeError: Maximum call stack size exceeded
    at TypeScriptInternals.getResolvedModule (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/TypeScriptInternals.js:87:29)
    at ExportAnalyzer._isExternalModulePath (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:196:74)
    at ExportAnalyzer._tryGetExternalModulePath (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:654:18)
    at ExportAnalyzer._tryMatchExportDeclaration (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:433:49)
    at ExportAnalyzer.fetchReferencedAstEntity (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:289:45)
    at ExportAnalyzer._tryGetExportOfAstModule (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:626:34)
    at ExportAnalyzer._getExportOfAstModule (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:599:32)
    at ExportAnalyzer._getExportOfSpecifierAstModule (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:594:32)
    at ExportAnalyzer._tryMatchExportDeclaration (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:442:29)
    at ExportAnalyzer.fetchReferencedAstEntity (/myProject/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:289:45)

I believe it's related to e8827cb
since my project uses aliases...

Reproduction

n/a

Steps to reproduce

No response

System Info

System:
    OS: macOS 14.1.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 676.05 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    npm: 10.2.1 - ~/myProject/node_modules/.bin/npm
  Browsers:
    Chrome: 120.0.6099.234
    Edge: 100.0.1185.39
    Safari: 17.1.2
  npmPackages:
    vite: ^5.0.11 => 5.0.11

Validations

@qmhc
Copy link
Owner

qmhc commented Jan 19, 2024

Please provide a reproduction.

@antoniosZ
Copy link
Author

@qmhc ok, I will try to provide one

@antoniosZ
Copy link
Author

@qmhc thankfully, I was able to reproduce it in the following MRE:
https://stackblitz.com/edit/vitejs-vite-ejbweg?file=src%2Fmain.ts&view=editor

Notes:

  1. by default, this MRE should install and attempt to build, which demonstrates the failure in the console
  2. the problem appears to be related to any import of a re-export, that has its name match a Path in tsconfig

Here's a second MRE with the only change, being using version 3.7.0, which shows everything working without errors...
https://stackblitz.com/edit/vitejs-vite-nfaykr?file=src%2Fmain.ts&view=editor

@antoniosZ
Copy link
Author

it appears that it tries to resolve the import MyConfig within the ./src/myTypes/index into ./src/myTypes/index and thus, causes an infinite recursion of path resolution...

@qmhc qmhc added pending Need further confirmation bug Something isn't working and removed pending Need further confirmation labels Jan 24, 2024
@qmhc qmhc changed the title build fails in 3.7.1 The match result of alias from paths in tsconfig.json is out of bounds Jan 24, 2024
@qmhc qmhc closed this as completed in 88469d0 Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants