You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4003 moved the definition of ImportMeta to a separate file and added a triple-slash directive to reference it. This works fine on case-insensitive operating systems, but not on linux. This seems to be because typescript converts the path to a lowercase string, vite/types/importmeta. This is not resolved on linux, and expressions like import.meta.env will throw a typescript error.
On mac, when I run npx tsc --traceResolution I get:
======== Type reference directive 'vite/types/importmeta' was successfully resolved to '/<absprojectpath>/node_modules/vite/types/importmeta.d.ts' with Package ID 'email@example.com', primary: false. ========
On Linux, my coworker sees:
======== Type reference directive 'vite/types/importmeta' was not resolved. ========
I think this is probably a typescript bug, but as a workaround I think it should be possible to rename the files to all-lowercase.
I'm not really sure how to show a reproduction of this problem...
### Used Package Manager
- [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
The text was updated successfully, but these errors were encountered:
This issue has been locked since it has been closed for more than 14 days.
If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.