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

instanceOf: workaround bundler issue with process.env #3923

Merged
merged 1 commit into from Jun 22, 2023

Commits on Jun 22, 2023

  1. instanceOf: workaround bundler issue with process.env

    Fixes: #3919 #3920 #3921
    Context: #3887 changed code and introced optinal chaining.
    `globalThis.process?.env.NODE_ENV` is transpiled into
    ```
    (_globalThis$process = globalThis.process) === null ||
    _globalThis$process === void 0
      ? void 0
      : _globalThis$process.env.NODE_ENV;
    ```
    Bundlers incorrectly replace (probably RegExp) `process.env.NODE_ENV` with `"development"` resulting in:
    ```
    (_globalThis$process = globalThis.process) === null ||
    _globalThis$process === void 0
      ? void 0
      : _globalThis$"development";
    ```
    
    Technically it's not a graphql issue but an issue with bundler but since it caused so much pain in comutinity this is an attempt to fix it within our codebase.
    IvanGoncharov committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    6108ae7 View commit details
    Browse the repository at this point in the history