question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Uncaught ReferenceError: __DEV__ is not defined` after updating to 3.4.0

See original GitHub issue

Intended outcome: Update to @apollo/client@3.4.0 in our apollo-angular application without issue, since the CHANGELOG indicates the addition of the __DEV__ environment variable should only add overhead to the application.

Actual outcome: Application crashes with Uncaught ReferenceError: __DEV__ is not defined error message in browser console.

How to reproduce the issue: Using Apollo Angular, so the React application template is not applicable. Let me know if I should open an issue in the apollo-angular repository.

Versions

  System:
    OS: macOS 11.5
  Binaries:
    Node: 12.22.2 - ~/.nvm/versions/node/v12.22.2/bin/node
    npm: 6.14.13 - ~/.nvm/versions/node/v12.22.2/bin/npm
  Browsers:
    Chrome: 92.0.4515.107
    Firefox: 89.0.1
    Safari: 14.1.2
  npmPackages:
    @apollo/client: 3.4.0 => 3.4.0 
    apollo-angular: 2.6.0 => 2.6.0 
    apollo-server-express: 3.0.2 => 3.0.2 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kettanaitocommented, Feb 9, 2022

Can reproduce on "@apollo/client": "^3.5.8" in a monorepo during testing. My test import a sibling repo which depends on @apollo/client.

  ● Test suite failed to run

    ReferenceError: __DEV__ is not defined

      at checkDEV (../../node_modules/@apollo/client/utilities/globals/index.js:5:5)
      at Object.<anonymous> (../../node_modules/@apollo/client/utilities/globals/index.js:12:1)
      at Object.<anonymous> (../../node_modules/@apollo/client/core/core.cjs:5:15)
1reaction
KeithGillettecommented, Jul 29, 2021

Thanks for the fast fix, @benjamn! @apollo/client@3.5.0-beta.1 runs without error in my apollo-angular project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`ReferenceError: __DEV__ is not defined` after update to `3.4 ...
On our production bundle (everything works fine on dev mode), we got this message on runtime ReferenceError: __DEV__ is not defined . We...
Read more >
React Uncaught ReferenceError: process is not defined
The problem is because you lose window.process variable when React hotloads, and process exists only on node, not the browser. So you should ......
Read more >
3 Ways to Solve jQuery - Uncaught ReferenceError: $ is not ...
1) One of the most common reason of "ReferenceError: $ is not defined" in jQuery based application is that jQuery plugin is included...
Read more >
Bug #1957717 “Project “Search” pages no longer work”
The browser developer console shows the following error: searchtools.js:158 Uncaught ReferenceError: Stemmer is not defined
Read more >
React ReferenceError: process is not defined | bobbyhadz
To solve the "Uncaught ReferenceError: process is not defined" in React, open your terminal in your project's root directory and update the version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found