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

@babel/plugin-proposal-class-properties TypeError #6793

Closed
mgcrea opened this Issue Nov 10, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@mgcrea

mgcrea commented Nov 10, 2017

Bug:

Compiling works fine but I can't run tests.

Looks like @babel/plugin-proposal-class-properties does not guard against an empty config and/or jest is not properly providing one.

    TypeError: Cannot read property 'loose' of undefined
      
      at _default (node_modules/@babel/plugin-proposal-class-properties/lib/index.js:21:23)
      at Function.memoisePluginContainer (node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
      at Function.normalisePlugin (node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
      at node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
          at Array.map (<anonymous>)
      at Function.normalisePlugins (node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
      at OptionManager.init (node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
      at File.initOptions (node_modules/babel-core/lib/transformation/file/index.js:212:65)
      at new File (node_modules/babel-core/lib/transformation/file/index.js:135:24)

Input Code

npm test
$ cat package.json | jq .scripts.test
"NODE_ENV=test jest"

Babel/Babylon Configuration (.babelrc, package.json, cli command)

{
  "presets": [
    ["@babel/env", {
      "targets": {
        "node": "4"
      }
    }]
  ],
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-object-rest-spread",
  ]
}

Your Environment

  "devDependencies": {
    "@babel/cli": "^7.0.0-beta.31",
    "@babel/core": "^7.0.0-beta.31",
    "@babel/plugin-proposal-class-properties": "^7.0.0-beta.31",
    "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.31",
    "@babel/plugin-transform-classes": "^7.0.0-beta.31",
    "@babel/preset-env": "^7.0.0-beta.31",
    "jest": "^21.2.1",
    "rimraf": "^2.6.2"
  },
@babel-bot

This comment has been minimized.

Show comment
Hide comment
@babel-bot

babel-bot Nov 10, 2017

Collaborator

Hey @mgcrea! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Collaborator

babel-bot commented Nov 10, 2017

Hey @mgcrea! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@hzoo

This comment has been minimized.

Show comment
Hide comment
@hzoo

hzoo Nov 10, 2017

Member

it's using an older version of babel-core that doesn't provide the 2nd options object facebook/jest#4557 shouldn't be our issue but we are trying to figure out peerDeps

function _default(_ref, options) {
  var t = _ref.types;
  var loose = options.loose;

basically jest is still requiring the old babel-core not @babel/core so we still need to figure that out

Member

hzoo commented Nov 10, 2017

it's using an older version of babel-core that doesn't provide the 2nd options object facebook/jest#4557 shouldn't be our issue but we are trying to figure out peerDeps

function _default(_ref, options) {
  var t = _ref.types;
  var loose = options.loose;

basically jest is still requiring the old babel-core not @babel/core so we still need to figure that out

@hzoo hzoo closed this Nov 10, 2017

@hzoo hzoo added the i: question label Nov 10, 2017

@lock lock bot added the outdated label May 4, 2018

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.