ljharb / es-abstract

ECMAScript spec abstract operations.
MIT License
114 stars 30 forks source link

"getOwnPropertyDescriptor" does not exist!!! #82

Closed sibinjoy100 closed 4 years ago

sibinjoy100 commented 4 years ago

Hi, When I am deploying code to Azure i am getting following error:

Can you guys help me to resolve this issue?

Application has thrown an uncaught exception and is terminated: SyntaxError: intrinsic %Object.getOwnPropertyDescriptor% does not exist!

-Sibin

ljharb commented 4 years ago

Is there any stack trace?

ljharb commented 4 years ago

What version of node are you using in azure?

sibinjoy100 commented 4 years ago

Stack trace: at GetIntrinsic (path\node_modules\es-abstract\GetIntrinsic.js:147:9) at Object. (path\node_modules\es-abstract\2019\CreateDataProperty.js:5:13) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at Module.patchedRequire [as require] (path\node_modules\diagnostic-channel\dist\src\patchRequire.js:14:46) at require (internal/modules/cjs/helpers.js:20:18)

Node version: 10.6.0

ljharb commented 4 years ago

Which version of es-abstract are you using?

I also note the patchedRequire - what is that? If you monkey with the way require works, you risk breaking lots of things.

ljharb commented 4 years ago

I'm going to close this for now; happy to reopen it if it can be reproduced.

underyx commented 4 years ago

My eslint invocation is failing for the same reason:

Failed to load plugin 'react' declared in '--config': Cannot find module '../helpers/getOwnPropertyDescriptor'
Require stack:
- /Users/underyx/random_project/eslint/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js
- /Users/underyx/random_project/eslint/node_modules/es-abstract/2019/CreateDataProperty.js
- /Users/underyx/random_project/eslint/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js
- /Users/underyx/random_project/eslint/node_modules/object.fromentries/implementation.js
- /Users/underyx/random_project/eslint/node_modules/object.fromentries/index.js
- /Users/underyx/random_project/eslint/node_modules/eslint-plugin-react/index.js
- /Users/underyx/random_project/eslint/node_modules/eslint/lib/cli-engine/config-array-factory.js
- /Users/underyx/random_project/eslint/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js
- /Users/underyx/random_project/eslint/node_modules/eslint/lib/cli-engine/cli-engine.js
- /Users/underyx/random_project/eslint/node_modules/eslint/lib/cli-engine/index.js
- /Users/underyx/random_project/eslint/node_modules/eslint/lib/cli.js
- /Users/underyx/random_project/eslint/node_modules/eslint/bin/eslint.js

after installing

  "devDependencies": {
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-plugin-import": "^2.20.1",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.18.3",
    "eslint-plugin-react-hooks": "^2.4.0"
  }

which locks to

    "es-abstract": {
      "version": "1.17.4",
      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz",
      "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==",
      "dev": true,
      "requires": {
        "es-to-primitive": "^1.2.1",
        "function-bind": "^1.1.1",
        "has": "^1.0.3",
        "has-symbols": "^1.0.1",
        "is-callable": "^1.1.5",
        "is-regex": "^1.0.5",
        "object-inspect": "^1.7.0",
        "object-keys": "^1.1.1",
        "object.assign": "^4.1.0",
        "string.prototype.trimleft": "^2.1.1",
        "string.prototype.trimright": "^2.1.1"
      }
    },
ljharb commented 4 years ago

@underyx does that mean you can make a repro repo for me? I maintain most of the packages you reference, and they all work together for everyone else, for a long time now, so I’d be very interested to figure this one out.

underyx commented 4 years ago

Thanks for getting back to me so quick @ljharb! No need to reopen, I just noticed that a teammate has committed their own corrupt node_modules which is what was causing my issues as well as a CI failure. I assume something similar happened to the original author as well.

I'm curious why it's this one file that ends up being left out when someone commits their node_modules, but I think the case is mostly closed.

ljharb commented 4 years ago

Committing node_modules is a bad practice for many many years now anyways :-) glad you figured it out!