react-orbitjs icon indicating copy to clipboard operation
react-orbitjs copied to clipboard

Change global object for UMD

Open bradjones1 opened this issue 2 years ago • 0 comments

I was getting a failure mode of

$ jest
 FAIL  __tests__/App.test.android.tsx
  ● Test suite failed to run

    ReferenceError: self is not defined

       7 | import Orbit from "@orbit/core";
    >  8 | import {DataProvider} from "react-orbitjs";
         | ^

running jest tests in an Expo project.

Per the webpack docs,

When targeting a library, especially when libraryTarget is umd, this option indicates what global object will be used to mount the library. To make UMD build available on both browsers and Node.js, set output.globalObject option to this

bradjones1 avatar Aug 17 '22 03:08 bradjones1