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

alias with $ breaks the plugin #294

Closed
3 tasks done
omridevk opened this issue Jan 7, 2024 · 2 comments
Closed
3 tasks done

alias with $ breaks the plugin #294

omridevk opened this issue Jan 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@omridevk
Copy link

omridevk commented Jan 7, 2024

Describe the bug

example:

    "paths": {
      "$styled-system/*": ["./styled-system/*"]
    }

in tsconfig.json

I think this is because of the regex you are using, need to somehow escape the dollar sign I believe.

Reproduction

cant.com

Steps to reproduce

No response

System Info

System:
    OS: macOS 14.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 100.06 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
    pnpm: 8.2.0 - ~/Library/pnpm/pnpm
  Browsers:
    Brave Browser: 115.1.56.20
    Chrome: 120.0.6099.199
    Chrome Canary: 122.0.6232.1
    Safari: 17.2.1
  npmPackages:
    @vitejs/plugin-react: ^4.0.0 => 4.2.1
    vite: ^5.0.0 => 5.0.11
    vite-plugin-dts: 3.5.2 => 3.5.2

Validations

@omridevk
Copy link
Author

omridevk commented Jan 7, 2024

This is where the error is coming from:
https://github.com/qmhc/vite-plugin-dts/blob/main/src/transform.ts#L131

const endSlash = matchResult[1].match(matchedAlias.find)![0].endsWith('/')

matchResult[1].match(matchedAlias.find)! return null and [0] fails.

@qmhc qmhc added the bug Something isn't working label Jan 15, 2024
@qmhc qmhc closed this as completed in e8827cb Jan 15, 2024
@omridevk
Copy link
Author

@qmhc
Thank you :D

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

Successfully merging a pull request may close this issue.

2 participants