-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails doesn't notice webpack-dev-server running when RAILS_ENV=test #1633
Comments
Do you have the same problem in dev? I'm seeing this in dev - Rails just not seeing the dev server running in another window... |
no, it works fine in |
It doesn't work for me in dev. Rails 6 beta3. Specifically, there's only manifest.json file in public/packs, nothing else. So the js is not compiled at all. |
@ryanscottaudio Did you ever get this working? I would also love for my tests not to recompile every time I run them. |
|
is there a way to work around/change something with that? it makes no sense from a development POV IMO |
It seems Webpacker is running with NODE_ENV=development in tests, even though RAILS_ENV=test. That means that it should still be possible, right? I tried inserting the following code in one of my React components: console.error("NODE ENV", process.env.NODE_ENV) Which gave me the following in my spec:
Can this issue be reopened? |
@ryanscottaudio, take a look at the comments here #1212 (comment) for the reasoning behind it. The Rails folks have no control over how node.js functions.
Yes, but there are multiple disparate issues at play here. In order to help debug, can @ryanscottaudio & @kjcommodi please post as much as you can of:
—to a single https://gist.github.com. Please tag me via |
i don't have access to the codebase i was using anymore, sorry |
@kjcommodi, I'll follow up with you in the gist & #2163 |
Every time I try to load a JS file through Rails when
RAILS_ENV=test
, I get[Webpacker] [INFO] Compiling…
in the console, even if in another console window i haveRAILS_ENV=test ./bin/webpack-dev-server
running. Here's my webpacker.yml:The purpose of running webpack-dev-server in test mode is just so that I can edit code to fix tests more efficiently (without webpack having to bundle all the affected files any time i want to load them); I wouldn't be running this in any sort of CI setting.
The text was updated successfully, but these errors were encountered: