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

[@babel/plugin-proposal-object-rest-spread] TypeError: Cannot read property 'references' of undefined #10339

Open
mvila opened this issue Aug 15, 2019 · 1 comment · May be fixed by #10343

Comments

@mvila
Copy link

commented Aug 15, 2019

Bug Report

Current Behavior

While transpiling some code involving object destructuring, the following error is thrown:

TypeError: Cannot read property 'references' of undefined
    at Object.keys.forEach.bindingName (.../node_modules/@babel/plugin-proposal-object-rest-spread/lib/index.js:146:45)

Input Code

function test(documents) {
  for (const {id, ...fields} of documents) {
    const func = () => {
      console.log(id);
    };

    func();
    console.log(fields);
  }
}

Expected behavior/code

@babel/plugin-proposal-object-rest-spread shouldn't throw an error.

Babel Configuration

Env preset browsers: 'safari 10' (see REPL link above)

Environment

  • Babel v7.5.5 running in the official REPL (see REPL link above)
@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Aug 15, 2019

Hey @mvila! 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.

JLHwung added a commit to JLHwung/babel that referenced this issue Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.