-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Uncaught ReferenceError: __DEFINES__ is not defined at env.ts:17:17 #14314
Comments
The only way to fix it was to delete the project folder and do a clean Which kind of hidden caches does I have seen other people have this bug so clearly it happens intermittently. |
Here's my gitignore in case this could help:
|
Find source code below in transform(code, id, options) {
console.log(id, normalizedClientEntry, normalizedEnvEntry) // <- add log here
// env variables should be injected when rollup find `env.ts` related `id`
if (id === normalizedClientEntry || id === normalizedEnvEntry) {
return injectConfigValues(code);
} Then you can provide the log info here and let's see whether there are some unexpected behaivors before |
I am getting the same error after updating dependencies. npm install
Test started with RTM enabled Stream hook test/hooks/useAuth.unit.test.tsx: 🚧 Browser logs: ❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information. This is on Ubuntu 22.04 and the same error occurs on GitHub actions with OS ubuntu-latest. |
Closing for now as we were not able to reproduce and there's not enough information to work on this. |
Describe the bug
Was using
vite
to develop a site with no problems for weeks.Suddenly I'm getting
Uncaught ReferenceError: __DEFINES__ is not defined at env.ts:17:17
in that line in
env.ts
it says:I have not changed my code in any way, I can also go back in my git history to any point in time, run
it'll still show the error.
So It can't have anything to do with my project setup, or the vite.config etc, since those worked fine for weeks now.
If I use a different macbook, with the same git repo, it works fine.
vite build
also works fine, it's only the development build that shows this problem when startinghttp://localhost:5173/
Reproduction
no reproduction
Steps to reproduce
reproduction only possible on one machine
System Info
Used Package Manager
yarn
Logs
Uncaught ReferenceError: DEFINES is not defined
at env.ts:17:17
Validations
The text was updated successfully, but these errors were encountered: