javascriptruby-on-railsbrowserifysprocketsbrowserify-rails

When using gem browserify-rails, it does not reflect file changes


I want to develop javascript with CommonJS module in rails. also I want to benefit from sprockets. I found browserify-rails gem to solve that. After tring, it seems to work well. I could use module. But when I change some files and refresh the browser, they are not reflected. Do you have an idea to solve that ?

using package.json is below.

{
  "name": "",
  "description": "",
  "license": "MIT",
  "repository": {},
  "dependencies": {
    "babelify": "^7.2.0",
    "browserify": "^12.0.1",
    "browserify-incremental": "^3.0.1"
  }
}

Solution

  • Unfortunately, a bug was introduced with browserify-rails v2 and is present in 2.0.0 and 2.0.1. I fixed the bug in 2.0.2 which was just released. Please upgrade to 2.0.2 and clear the asset cache with:

    rake tmp:clear

    You may need to call it like bundle exec rake tmp:clear. If neither work, then from the project root, rm -rf tmp/cache. Then start Rails again and it should work as expected.