royriojas / esformatter-jsx

esformatter plugin: format jsx files (or js files with Facebook React JSX Syntax)
MIT License
142 stars 25 forks source link

Fix the version of babylon in use #49

Closed jesstelford closed 8 years ago

jesstelford commented 8 years ago

To avoid running into this bug: https://phabricator.babeljs.io/T6930

I'm not sure what is actually causing the problem, but I'm guessing it's a minor/patch upgrade version in babylon which is broken.

To clarify; here's the minimal reproduction case where I see this:

package.json

{
  "name": "foo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "browserify": "^13.0.0",
    "esformatter-jsx": "4.1.0"
  }
}

index.js

require('html-to-react-components');

Then run:

./node_modules/.bin/browserify index.js > out.js

And get this error:

Error: Cannot find module './parser' from '/tmp/tmp6/node_modules/babylon'
    at /tmp/tmp6/node_modules/resolve/lib/async.js:55:21
    at load (/tmp/tmp6/node_modules/resolve/lib/async.js:69:43)
    at onex (/tmp/tmp6/node_modules/resolve/lib/async.js:92:31)
    at /tmp/tmp6/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)

shell returned 1
royriojas commented 8 years ago

will accept the pull request, but I guess babylon will have to find a way to fix the issue on their own side as well, bundling doesn't seem to be friendly.

royriojas commented 8 years ago

@jesstelford published v4.1.1

jesstelford commented 8 years ago

Agreed. Thanks for publishing it so quickly :+1: