-
-
Notifications
You must be signed in to change notification settings - Fork 8k
[2.4.0-beta.0] New typescript errors for css and import.meta.env #4002
Copy link
Copy link
Closed
Description
Describe the bug
I attempted an upgrade to vite 2.4.0-beta.0, and I've now started to get two types of typescript errors which I did not have before.
CSS imports:
src/screens/login/Login.tsx:11:20 - error TS2307: Cannot find module './Login.module.css' or its corresponding type declarations.
11 import styles from './Login.module.css';
And
src/index.tsx:6:33 - error TS2339: Property 'env' does not exist on type 'ImportMeta'.
6 const environment = import.meta.env.MODE;
I have "types": ["vite/client"], in my tsconfig.json, but the vite client types don't seem to be picked up. I get Cannot find type definition file for 'vite/client'.
Reproduction
System Info
System:
OS: macOS 11.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 66.11 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.16.1/bin/yarn
npm: 7.17.0 - ~/.nvm/versions/node/v14.16.1/bin/npm
Browsers:
Brave Browser: 91.1.26.67
Firefox: 88.0.1
Safari: 14.1.1
npmPackages:
vite: ^2.4.0-beta.0 => 2.4.0-beta.0Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels