-
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
Running webpack's script inside Rails project in Windows 10 x64 doesn't work #245
Comments
Related issue with rails webpacker:install on Windows. To be able to run
I can now install and run other webpacker commands successfully. Not sure if this helps :\ |
@rodoneill Did you dig deeper into this issue? Perhaps, if you can make a PR to fix the issue :) |
|
The above patch lets me run webpacker install on Windows, and should work on all platforms. It does mean that if you run Rails with one version of Ruby, the same version of Ruby will be used to run nested commands. Previously, the version of Ruby specified in the #! line at the top of the file was used (a feature common to Unix shells, but not present on Windows). |
It seems this issue has been closed in error, as only the webpacker:install command appears to have been fixed, but newenv = { "NODE_PATH" => NODE_MODULES_PATH }
cmdline = [WEBPACK_BIN, "--config", WEBPACK_CONFIG] + ARGV
Dir.chdir(APP_PATH) do
exec newenv, *cmdline
end |
@fsateler Thanks 👍 Want to make a PR for this? |
…directly Windows cmd does not support the ENVVAR=VALUE syntax prepended to a command, so the binstubs did not work there. To avoid that, use the exec form that does not go via the shell, and instead executes the program directly. Fixes: rails#245
I'm not sure this issue should be closed. I'm still getting the same error when loading webpacker from the Github repository in my Gemfile. |
@fny Did you upgrade the config files after updating from master? Gemfile gem 'webpacker', github: 'rails/webpacker' (update/replace all files prompted)
|
Just tried that and it made no difference. I still see the following error when I try to start the tests:
I see the Note this is with a repository that's already working without any issue on my 'nix machines. |
|
Not with `ruby` prefixed.
…On Jul 25, 2017 5:41 PM, "Gaurav Tiwari" ***@***.***> wrote:
ruby ./bin/webpack-dev-server you are running this from command line?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#245 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVH1KRis8esufYh0YKYLnl3RHnr8QYWks5sRmEUgaJpZM4M3n_M>
.
|
Do you want to request a feature or report a bug?
BUG
What is the current behavior?
Running webpack's script inside Rails project in Windows 10 x64 doesn't work properly. Same goes for rake webpacker:compile or webpack-watcher. To fix the first issue (bin/webpack) I deleted NODE_PATH=#{NODE_MODULES_PATH} from the exec (line 38)
It seems that the environment must be set before the exec for Windows
If the current behavior is a bug, please provide the steps to reproduce.
For first one:
Second one:
Third one:
Tasks: TOP => webpacker:compile
(See full trace by running task with --trace)
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Node.js version: 7.8
Webpack version: 2.3.2
Windows 10 x64
This issue was moved from webpack/webpack#4661 by @sokra. Orginal issue was by @jarrieta86.
The text was updated successfully, but these errors were encountered: