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

Enums that named with the word T started will be unexpectedly imported from a wrong path #733

Open
5 tasks done
polarove opened this issue Jan 29, 2024 · 2 comments
Open
5 tasks done

Comments

@polarove
Copy link

Describe the bug

Prerequisites: unplugin-vue-components && unplugin-auto-import && tdesign-vue-next

When we have any enum that its name starts with the word T:

export enum THEME {
    LIGHT
}

And use it:

import { THEME } from `~`
console.log(THEME.LIGHT)

This would result in an error that something unexpectedly re-writes the import path towards tdesign-vue-next libary.

How to reproduce it:

  1. Hit the reproduction link below
  2. Run the project
  3. Check your console and keep cleanning it untill you see an Uncaught SyntaxError:
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/tdesign-vue-next.js?v=e1b92d83' does not provide an export named 'HEME2' (at enum.ts:1:10)

Reproduction

https://stackblitz.com/edit/vitejs-vite-rbldp3?file=src%2Fenum.ts,src%2FApp.vue,package.json,src%2Fmain.ts&terminal=dev

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 3600X 6-Core Processor
    Memory: 4.46 GB / 15.95 GB
Binaries:
    Node: 20.9.0 - C:\DevTool\node\node.EXE
    Yarn: 1.22.21 - C:\DevTool\node\yarn.CMD
    npm: 10.1.0 - C:\DevTool\node\npm.CMD
    pnpm: 8.10.5 - C:\DevTool\node\pnpm.CMD
Browsers:
    Edge: Chromium (121.0.2277.83)
    Internet Explorer: 11.0.19041.3636

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Copy link

stackblitz bot commented Jan 29, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Sight-wcg
Copy link
Contributor

Sight-wcg commented Feb 11, 2024

related #552 #505

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

No branches or pull requests

2 participants