browserify / watchify

watch mode for browserify builds
Other
1.79k stars 203 forks source link

Watchify throwing "Parse Error" when used as npm sub-run-task #288

Closed nakwa closed 8 years ago

nakwa commented 8 years ago

Hi,

I have the following package.json:

  "scripts": {
    "nodemon": "ENV=development DEBUG=express:* nodemon -e coffee,js,jade,json,jsx,cjsx ./server/app.coffee --args --nodejs",
    "watchify": "watchify -t coffee-reactify ./client/app.coffee -o ./build/app.js",
    "browserify": "browserify -t coffee-reactify ./client/app.coffee -o ./build/app.js",
    "build": "npm run browserify",
    "dev": "npm run watchify & npm run nodemon",
    "start": "npm run build & ENV=production coffee ./server/app.coffee"
  },
  "dependencies": {
    "coffee-script": "^1.10.0"
  },
  "devDependencies": {
    "browserify": "^11.0.1",
    "watchify": "^3.6.1",
    "coffee-react-transform": "^2.1.0",
    "coffee-reactify": "^2.1.0",
    "coffeeify": "^1.1.0",
    "nodemon": "^1.4.0",
    "watchify": "^3.3.1"
  }

Whenever I run directly npm run build my application gets packaged without any problem. If I run npm run dev - which trigger npm run watchify and npm run nodemon - I immediately get a parse error :

console.error("Error: Parsing file /Users/nakwa/projects/my_app/sources/app.coffee: Unexpected token (1:19)");

This is after cloning again the git repository, it was working fine before that.

Any clue what can cause this behavior ? Thank you,

zertosh commented 8 years ago

It must be that the transform isn't getting applied. But you setup looks fine on the surface. Can you provide me with a small repro case?

zertosh commented 8 years ago

Closing for lack of activity. @nakwa Please re-open if you can provide more detail.