acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
648 stars 74 forks source link

1.1.0 breaks dependency chain from eslint-plugin-react #24

Closed conatus closed 9 years ago

conatus commented 9 years ago

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

arendjr commented 9 years ago

Having the same problem. Pinning acorn-jsx to 1.0.3 fixed it for me.

arendjr commented 9 years ago

For Google: The error I got was "Invalid mapping" while parsing JSX files.

conatus commented 9 years ago

For me it was within eslint-plugin-react

return node.loc.start.line !== node.loc.end.line;
                         ^
TypeError: Cannot read property 'line' of undefined
conatus commented 9 years ago

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.

RReverser commented 9 years ago

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.