babel-plugin-parameter-decorator icon indicating copy to clipboard operation
babel-plugin-parameter-decorator copied to clipboard

`Cannot read property 'referencePaths' of undefined`

Open vjpr opened this issue 4 years ago • 2 comments

var binding = stmt.scope.getBinding(specifier.local.name);

It seems binding can sometimes be undefined. This occurred for me when specifier.local.name = _jsxDEV.

Investigating further...

vjpr avatar Dec 10 '20 00:12 vjpr

Looks related to react@17 and new jsx-runtime. https://babeljs.io/blog/2020/03/16/7.9.0#a-new-jsx-transform-11154httpsgithubcombabelbabelpull11154

import { jsx as _jsx } from "react/jsx-runtime";
function Foo() {
  return _jsx("div", ...);
}

I have published a patch at npm install @vjpr/babel-plugin-parameter-decorator.

vjpr avatar Dec 10 '20 14:12 vjpr

Sorry for the truly late, could you provide more details to reproduce?

WarnerHooh avatar Aug 03 '21 09:08 WarnerHooh