Skip to content
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: __DEV__ is not defined after updating to 3.4.0 #8557

Closed
KeithGillette opened this issue Jul 29, 2021 · 5 comments · Fixed by #8558 or CDCgov/prime-simplereport#2206

Comments

@KeithGillette
Copy link
Contributor

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 
@KeithGillette KeithGillette changed the title Uncaught ReferenceError: __DEV__ is not defined after updating 3.4.0 Uncaught ReferenceError: __DEV__ is not defined after updating to 3.4.0 Jul 29, 2021
@benjamn
Copy link
Member

benjamn commented Jul 29, 2021

@KeithGillette Do you have a stack trace for the ReferenceError?

@KeithGillette
Copy link
Contributor Author

Hi @benjamn — Here's the full log:

object-canon.js:71 Uncaught ReferenceError: __DEV__ is not defined
    at ObjectCanon.push.29723.ObjectCanon.admit (object-canon.js:71)
    at new ObjectCanon (object-canon.js:18)
    at Module.29723 (object-canon.js:111)
    at __webpack_require__ (bootstrap:24)
    at fn (hot module replacement:61)
    at Module.97564 (vendor.js:112246)
    at __webpack_require__ (bootstrap:24)
    at fn (hot module replacement:61)
    at Module.2679 (vendor.js:110977)
    at __webpack_require__ (bootstrap:24)
push.29723.ObjectCanon.admit @ object-canon.js:71
ObjectCanon @ object-canon.js:18
29723 @ object-canon.js:111
__webpack_require__ @ bootstrap:24
fn @ hot module replacement:61
97564 @ vendor.js:112246
__webpack_require__ @ bootstrap:24
fn @ hot module replacement:61
2679 @ vendor.js:110977
__webpack_require__ @ bootstrap:24
fn @ hot module replacement:61
95239 @ index.js:4
__webpack_require__ @ bootstrap:24
fn @ hot module replacement:61
80811 @ app-routing.module.ts:131
__webpack_require__ @ bootstrap:24
fn @ hot module replacement:61
35054 @ app.component.ts:25
__webpack_require__ @ bootstrap:24
fn @ hot module replacement:61
10300 @ media-type.types.ts:28
__webpack_require__ @ bootstrap:24
__webpack_exec__ @ main.js:5892
(anonymous) @ main.js:5893
__webpack_require__.O @ chunk loaded:25
(anonymous) @ main.js:5894
webpackJsonpCallback @ jsonp chunk loading:559
(anonymous) @ main.js:1

@benjamn
Copy link
Member

benjamn commented Jul 29, 2021

@KeithGillette Can you try with @apollo/client@3.5.0-beta.1 (or by running npm i @apollo/client@beta)? If that solves your problem, we'll merge PR #8558 to main and release it as @apollo/client@3.4.1 ASAP.

@benjamn benjamn added this to the v3.4.x patch releases milestone Jul 29, 2021
@KeithGillette
Copy link
Contributor Author

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

@kettanaito
Copy link

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)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.