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

Version 3.8.1 doesn't work with path aliases #317

Closed
3 tasks done
ohkimur opened this issue Apr 2, 2024 · 4 comments
Closed
3 tasks done

Version 3.8.1 doesn't work with path aliases #317

ohkimur opened this issue Apr 2, 2024 · 4 comments
Labels
bug Something isn't working need reproduction Should provide a reproduction

Comments

@ohkimur
Copy link

ohkimur commented Apr 2, 2024

Describe the bug

Since version 3.8.1, the plugin doesn't update the paths as 3.7.3.

Reproduction

Steps to reproduce

I identified 2 cases where the plugin doesn't work as expected:

  1. When using the plugin with vite-tsconfig-paths
  2. When using the plugin with aliases like the following:
resolve: {
  alias: {
    "@": resolve(fileURLToPath(new URL(".", import.meta.url)), "./src"),
  },
},

System Info

System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 67.84 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.5.0 - ~/.nvm/versions/node/v21.5.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v21.5.0/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v21.5.0/bin/npm
    pnpm: 8.15.4 - ~/Library/pnpm/pnpm
  Browsers:
    Safari: 17.3.1

Validations

@qmhc
Copy link
Owner

qmhc commented Apr 3, 2024

Please provide a reproduction.

@qmhc qmhc added the need reproduction Should provide a reproduction label Apr 3, 2024
@CodingDive
Copy link

@qmhc thank you so much for all your work on this package! ❤️

We are also using path aliases and I'm running into the same issue with anything above version 3.6.4. Not sure if the problem is in this repo, or in the api-extractor repo.

error during build:
Error: [vite:dts] Internal Error: Symbol not found for identifier: import("@editor/plugin").ChildStateType<string, unknown>
/frontend/packages/editor/dist/packages/editor/src/plugins/article/index.d.ts:4:19

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
    at ExportAnalyzer.fetchReferencedAstEntityFromImportTypeNode (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:355:19)
    at AstSymbolTable._fetchEntityForNode (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:384:60)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:361:52)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
    at AstSymbolTable._analyzeChildTree (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:247:18)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:170:19)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:170:19)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:170:19)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:170:19)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)
    at /frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:259:34
    at AstDeclaration.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstDeclaration.js:168:9)
    at AstSymbol.forEachDeclarationRecursive (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbol.js:103:28)
    at AstSymbolTable._analyzeAstSymbol (/frontend/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:254:27)

Reproduction:
serlo/frontend#3554

  1. git clone git@github.com:serlo/frontend.git
  2. cd frontend && yarn
  3. cd packages/editor && yarn build
  4. In package.json bump vite-plugin-dts, run yarn followed by yarn build. Should get the error I got above.

@qmhc qmhc added need more info Further information is requested pending Need further confirmation and removed need more info Further information is requested labels Apr 12, 2024
@qmhc
Copy link
Owner

qmhc commented Apr 12, 2024

@CodingDive I reproduced your case and now I'm looking for the reason.

But I'm not sure if your problem is the same as @ohkimur.

@qmhc qmhc added bug Something isn't working and removed pending Need further confirmation labels Apr 12, 2024
@qmhc qmhc closed this as completed in 0d204d9 Apr 12, 2024
@ohkimur
Copy link
Author

ohkimur commented Apr 13, 2024

@qmhc This solved my issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need reproduction Should provide a reproduction
Projects
None yet
Development

No branches or pull requests

3 participants