Closed dbackeus closed 8 years ago
Same issue underneath as https://github.com/browserify-rails/browserify-rails/issues/101. I should have a fix out shortly. My apologies.
Would you please upgrade to 2.0.2 and confirm this fixes the issue for you? Thank you in advance.
Fixed it for me! @cymen I came here looking for the bug, and you were fixing it in real-time :) great work! :+1:
@caesarsol Excellent! Thanks for confirming. I no longer have a big project to test browserify-rails on (due to switching employers) so I'm always a bit nervous in judging if something is truly fixed! Tests help of course but some things are tricky to test for (in theory, we do have a test that should have caught this but somehow the test environment differs from development env).
That's true... But wait for @dbackeus feedback because also my project is not so big :)
I should also tell you that on a coworker's machine we had to clean the browserifyinc
cache to make it work.
It seemed not to work at first but then after messing about back end forth it started to work so I think the fix is valid :)
Might have been the browserifyinc cache mentioned above... though I didn't manually do anything to clear it. What was the commend for that @caesarsol?
@dbackeus I doubt it's the "right" way, but I simply do rm -r tmp/cache
from the application directory :)
Because I saw the browserifyinc
cache files in there.
Guess you could do rake tmp:cache:clear
or something similar?
Right -- I ran into the same thing with needing to blow away tmp/cache
. I believe that sprockets includes the dependency graph in the cache files so it persists between server restarts. That was very surprising! So if the dependency graph is wrong, it'll stay wrong until the cache is cleared. I forgot to mention it.
You can also run bundle exec rake tmp:clear
which should do the same thing as rm -rf tmp/cache
.
Closing as I'm fairly certain this is resolved. Please do not hesitate to reopen in the event there are still issues.
We're actually still seeing files not reloading after change.
We're note sure why it happens. It seems a bit random but when it stops working it's fairly consistently stuck. Even clearing the tmp folder at that point appears to re-transpile old versions of files sometimes... we haven't troubleshooted enough to give any certain patterns.
Using 1.5.0 still seems the most stable option.
yes, I had the exact some problem too! no time to debug though, will try the next time
On 8 Dec 2015 4:59 p.m., "David Backeus" notifications@github.com wrote:
We're actually still seeing files not reloading after change.
We're note sure why it happens. It seems a bit random but when it stops working it's fairly consistently stuck. Even clearing the tmp folder at that point appears to re-transpile old versions of files sometimes... we haven't troubleshooted enough to give any certain patterns.
Using 1.5.0 still seems the most stable option.
— Reply to this email directly or view it on GitHub.
@dbackeus @caesarsol Are either of you using other things that would hook into the asset pipeline? We might need to pull 2.0. I like the idea but if it isn't working... Unfortunately, I don't use this project day to day anymore so I don't have a good sense of when things are not working well.
We're using react-rails, don't know if they do anything out of the ordinary. Also the Rack::Deflater middleware to compress assets.
Full application.rb config is:
# Use Rack::Deflator for gzipped assets in dev env (in production we use heroku-deflater)
config.middleware.use Rack::Deflater if Rails.env.development?
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run 'rake -D time' for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.react.variant = :production
config.react.addons = true
config.react.max_renderers = 10
config.react.timeout = 20 # seconds
config.react.react_js = -> { "" }
config.react.component_filenames = ["components-server.js"]
# Browserify
# Enable source map for development
config.browserify_rails.source_map_environments << "development"
config.browserify_rails.commandline_options =
%(-t coffee-reactify -t pkgify --extension=".coffee" --extension=".cjsx")
config.generators do |g|
g.view_specs false
g.routing_specs false
g.stylesheets false
g.javascripts false
g.helper false
end
After upgrading from browserify-rails from 1.5 to 2.0.1 our coffeescript assets (.coffee and .cjsx) don't update after saving changes (stuck in cache?).
Our browserify config in application.rb looks like:
Downgrading to 1.5 makes it work again. Please let us know if we can help you debug this further.