Object Cannot read property 'defineProperties'

Hi so I’m building a Shopify App that makes heavy use of this. Everything was working fine locally but then I had to use Next.js and this error started happening.

Unhandled Rejection (TypeError): Cannot read property ‘defineProperties’ of undefined

Its happening on the first Object.defineProperties, meaning Object is undefined. I think its an issue with webpack or babel but there isn’t much online any advice.

My package.json

“name”: “sample-embedded-app”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”,
“dev”: “node server.js”,
“build”: “next build”,
“start”: “next start”
“keywords”: [],
“author”: “”,
“license”: “ISC”,
“dependencies”: {
@shopify/koa-shopify-auth”: “^3.1.7”,
@shopify/koa-shopify-graphql-proxy”: “^2.1.3”,
@shopify/koa-shopify-webhooks”: “^1.1.4”,
@shopify/polaris”: “^3.2.1”,
@zeit/next-css”: “^1.0.1”,
@zeit/next-sass”: “^1.0.1”,
“apollo-boost”: “^0.1.22”,
“axios”: “^0.18.0”,
“dotenv”: “^6.1.0”,
“gojs”: “^2.0.8”,
“graphql”: “^14.0.2”,
“isomorphic-fetch”: “^2.2.1”,
“js-cookie”: “^2.2.0”,
“koa”: “^2.6.2”,
“koa-router”: “^7.4.0”,
“koa-session”: “^5.10.0”,
“next”: “^7.0.2”,
“node-sass”: “^4.11.0”,
“react”: “^16.6.3”,
“react-apollo”: “^2.3.2”,
“react-dom”: “^16.6.3”,
“store-js”: “^2.0.4”

Did you figure out the configuration problem? For Object to be undefined, it must have been pretty bad.

Hi Northwoods team,

We’re affected by the same issue when loading a module which loads ‘gojs’. After investigating what the issue is, we can confirm that replacing ma.Object with Object inside https://github.com/NorthwoodsSoftware/GoJS/blob/master/release/go.js “fixes” the issue successfully, but obviously is not maintainable for us that we patch this release bundle.

Could you please help us tracking this error? We’re in the middle of POC of Gojs, so any help would be appreciated.

Thank you.

How are you loading the GoJS library? Script tag, require, or import? If import, which module system are you using? Or is everything packed somehow?

Are you using any extensions? If so, which one(s)? And how are you loading them? We normally recommend that you copy the extension source code into your project so that you can make sure you load it and its dependency on GoJS in the correct manner for your app.

Sadly no team member is familiar with the webpack setup at the moment, which I understand is key to get support from you.

It only happens when running tests via mocha+babel/register, in the context of our unit tests for React components (we are using gojs together with gojs-react).

I’ll see if we can somehow isolate the issue in a different repo. Thanks in advance.