Skip to content
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

Update debugging instructions #2422

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/troubleshooting.md
Expand Up @@ -4,11 +4,13 @@

1. Read the error message carefully. The error message will tell you the precise key value
that is not matching what Webpack expects.
2. Put a `debugger` statement in your Webpack configuration and run `bin/webpack --debug`.
2. Put a `debugger` statement in your Webpack configuration and run `bin/webpack --debug-webpacker`.
If you have a node debugger installed, you'll see the Chrome debugger for your webpack
config. For example, install the Chrome extension [NiM](https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj) and
set the option for the dev tools to open automatically. For more details on debugging,
see the official [Webpack docs on debugging](https://webpack.js.org/contribute/debugging/#devtools)
3. Any arguments that you add to bin/webpack get sent to webpack. For example, you can pass `--debug` to switch loaders to debug mode. See [webpack CLI debug options](https://webpack.js.org/api/cli/#debug-options) for more information on the available options.
4. You can also pass additional options to the command to run the webpack-dev-server and start the webpack-dev-server with the option `--debug-webpacker`

## ENOENT: no such file or directory - node-sass

Expand Down
3 changes: 1 addition & 2 deletions lib/webpacker/dev_server_runner.rb
Expand Up @@ -52,9 +52,8 @@ def execute_cmd
["yarn", "webpack-dev-server"]
end

if ARGV.include?("--debug")
if ARGV.include?("--debug-webpacker")
gauravtiwari marked this conversation as resolved.
Show resolved Hide resolved
cmd = [ "node", "--inspect-brk"] + cmd
ARGV.delete("--debug")
end

cmd += ["--config", @webpack_config]
Expand Down
3 changes: 1 addition & 2 deletions lib/webpacker/webpack_runner.rb
Expand Up @@ -12,9 +12,8 @@ def run
["yarn", "webpack"]
end

if ARGV.include?("--debug")
if @argv.include?("--debug-webpacker")
gauravtiwari marked this conversation as resolved.
Show resolved Hide resolved
cmd = [ "node", "--inspect-brk"] + cmd
ARGV.delete("--debug")
end

cmd += ["--config", @webpack_config] + @argv
Expand Down