`ReferenceError: __DEV__ is not defined` after update to `3.4.5` with `Next.js` app
See original GitHub issueIntended outcome:
After updating to 3.4.5
, on our Next.JS@11.1.0
app, we expect that our app launch with any problem.
Actual outcome:
On our production bundle (everything works fine on dev mode), we got this message on runtime ReferenceError: __DEV__ is not defined
. We had the same problem with the 3.4.0
, but it has been fixed on 3.4.1
following this issue #8557.
Something may have changed between 3.4.4
and 3.4.5
, and still here on 3.4.8
.
How to reproduce the issue:
Our repo is private but let me know if you want me to setup a simple exemple with NextJS / Apollo to have some tests. We have this problem on our every nextJS app using @apollo/client>3.4.4
.
Versions
System:
OS: macOS 11.5.2
Binaries:
Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.14 - ~/.nvm/versions/node/v14.17.5/bin/npm
Browsers:
Chrome: 92.0.4515.159
Firefox: 91.0.1
Safari: 14.1.2
npmPackages:
@apollo/client: 3.4.5 => 3.4.5
Issue Analytics
- State:
- Created 2 years ago
- Comments:27 (9 by maintainers)
Top Results From Across the Web
module-not-found - Next.js
A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies;...
Read more >Window is not defined in Next.js React app - Stack Overflow
The error occurs because window is not yet available, while component is still mounting. You can access window object after ...
Read more >How to Fix "localStorage is not defined" in Next.js
You've tried to use localStorage in your Next.js application and you're getting the following error: ReferenceError: localStorage is not defined ...
Read more >Fixing Next js "ReferenceError: document is not defined"
The error is thrown because document is only available inside the browser and not on the server. Next js executes this code on...
Read more >Getting Referenceerror: Appearance Is Not Defined - ADocLib
ReferenceError : DEV is not defined after update to 3.4.5 with Next.js app If everything looks good those changes will probably get.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, I just found this issue - this just started happening to me after upgrading to
v3.4.10
using Vite & Vue.Vite users can use a function in vite.config.js and set a define option: