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

Webpack debugging #23

Open
jconnolly-bond opened this issue Sep 17, 2018 · 0 comments
Open

Webpack debugging #23

jconnolly-bond opened this issue Sep 17, 2018 · 0 comments

Comments

@jconnolly-bond
Copy link

I am trying to get debugging working on a webpack project, breakpoints work when using chrome but won't connect when launching with nwjs. The app runs but won't attach and gives this error:

"Can't find a valid target that matches: chrome-extension://*/http://localhost:8080/. Available pages: [\"http://localhost:8080/\",\"chrome-extension://flfgfkddlialhfnmegcdcikgimlflfhn/_generated_background_page.html\"]"

Any advice would be greatly appreciated.

launch.json:

{
        "type": "nwjs",
        "request": "launch",
        "name": "Launch NWjs",
        "nwjsVersion": "any",
        "webRoot": "${workspaceFolder}",
        "sourceMaps": true,
        "port": 9233,
        "trace": "verbose"
}

webpack.config.js:

const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
    mode: "development",
    entry: {
        app: "./src/app.js"
    },
    devtool: "source-map",
    devServer: {
        contentBase: "dist"
    },
    stats: {
        colors: true
    },
    output: {
        path: path.resolve(__dirname, "dist"),
        filename: "[name].bundle.js"
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ["style-loader", "css-loader"]
            },
            {
                test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
                loader: "url-loader",
                options: {
                    limit: 8192
                }
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: "test app",
            filename: "index.html"
        })
    ]
};

package.json

{
  "name": "app-test",
  "version": "0.0.1",
  "description": "nwjs + webpack",
  "scripts": {
    "start": "webpack-dev-server --hot --port 8080",
    "build": "webpack -p"
  },
  "devDependencies": {
    "css-loader": "latest",
    "eslint": "latest",
    "file-loader": "latest",
    "html-webpack-plugin": "latest",
    "style-loader": "latest",
    "url-loader": "latest",
    "webpack": "latest",
    "webpack-cli": "latest",
    "webpack-dev-server": "latest"
  },
  "main": "http://localhost:8080/",
  "window": {
    "width": 1920,
    "height": 1080
  }
}
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

1 participant