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

issues running Visual Studio Code Debugger with webpack-dev-server #785

Closed
kryptonianson opened this issue Feb 10, 2017 · 5 comments
Closed

Comments

@kryptonianson
Copy link

kryptonianson commented Feb 10, 2017

I have an issue with getting webpack-dev-server to run from the debugger in Visual Studio Code on Windows 10. The project runs perfectly on Linux and Mac, but for some reason it errors out on windows. It also works fine from VSC's tasks implementation, and from the command line on all platforms. Thank you in advance for your help.

Please note I have posted this issue in two other places in case this is not a bug in webpack-dev-server:

http://stackoverflow.com/questions/42138058/webpack-dev-server-not-working-from-debugger-on-windows-10

microsoft/vscode#20350

The error I get on windows is the following:

Cannot launch program 'c:\devel\src\MyWebKit\node_modules.bin\webpack-dev-server'; setting the 'outFiles' attribute might help.

My current setup is:

VSC: 1.9.1
OS: Windows 10 Anniversary
webpack: 2.2.1
webpack-dev-server: 2.3.0

My configuration launch.json file for VSC:

{
  "version": "0.2.0",
  "configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "${workspaceRoot}/node_modules/.bin/webpack-dev-server",
        "args": [
            "-d",
            "--config",
            "webpack/default.js"
        ],
        "outFiles": [
            "${workspaceRoot}/build/*"
        ],
        "stopOnEntry": false,
        "cwd": "${workspaceRoot}",
        "runtimeExecutable": null,
        "runtimeArgs": [],
        "env": {
            "NODE_ENV": "development"
        },
        "console": "internalConsole",
        "sourceMaps": true
    }
  ]
}
@SpaceK33z
Copy link
Member

Sorry but as far as I know this can't be an issue in webpack-dev-server. It works perfectly fine in the console, so I don't see how it not running in VSC is an issue of webpack-dev-server. In microsoft/vscode#20350 they never said it was an issue in WDS?

@kryptonianson
Copy link
Author

I agree with your comment, but since I am getting nowhere I thought it worth a shot here. Also, no one has said it was due to WDS, I was just trying to do my due diligence. I appreciate your response.

@SpaceK33z
Copy link
Member

I'm going to close this since there is nothing I can do here...

@sjones6
Copy link

sjones6 commented Dec 8, 2017

@kryptonianson ... recognize this is an old, closed thread. That error message from VSCode and is super unclear.

Chances are that Windows doesn't like trying execute webpack-dev-server in the node_modules/.bin. Try changing the "program" option to node_modules/webpack-dev-server:

        {
            "type": "node",
            "request": "launch",
            "name": "webpack-dev-server",
            "program": "${workspaceRoot}/node_modules/webpack-dev-server/bin/webpack-dev-server.js",
            "cwd": "${workspaceFolder}"
        }

Leaving this hear in case it helps someone in the future.

@femvc
Copy link

femvc commented May 10, 2019

I occur the same problem. After tried different ways, the follow config is working.
launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      // "program": "cd ${workspaceFolder};npm run dev"
      "program": "${workspaceFolder}\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js",
      "args": [
        "-d",
        "--inline",
        "--progress",
        "--config",
        "build\\webpack.dev.conf.js"
      ],
      "cwd": "${workspaceFolder}"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants