Closed conatus closed 9 years ago
Having the same problem. Pinning acorn-jsx to 1.0.3 fixed it for me.
For Google: The error I got was "Invalid mapping" while parsing JSX files.
For me it was within eslint-plugin-react
return node.loc.start.line !== node.loc.end.line;
^
TypeError: Cannot read property 'line' of undefined
Just in case people don't understand how to pin dependencies. Simply declare acorn-jsx as 1.0.3 in your package.json and this will cause babel-core to use this.
Thanks.
Sorry guys.
Somewhere between 1.0.3
and 1.2.2
Acorn changed startNodeAt
API making it incompatible with older versions. Later it went into 2.0.0
but old version wasn't unpublished so I got incompatibilities and had to bump minor version as well.
Now, I unpublished 1.1.0 from the registry so everything should work as before. Updated version is now published as 2.0.0.
See https://github.com/yannickcr/eslint-plugin-react/issues/120
eslint-plugin-react depends on babel-core which depends on acorn-jsx.
Fix is to downgrade acorn-jsx to 1.0.3