3

Hello I am trying debug js code using Visual code. Visual code not stoping at breakpoint complaining its not able to find proper .

My webpack config looks like this

{
        'mode': mode,
        entry: {
            lapp: './src/app.js',
        },  
        devtool: 'source-map',
        output: {
            path: path.join(__dirname, 'build'),
            filename: '[name].js',
            publicPath: "/build/",
            libraryTarget: 'umd',
            library: 'LAPP'
        }

    },

Visual code debug config looks like

 "version": "0.2.0",
    "configurations": [

        {
            "name": "Launch localhost",
            "type": "chrome",
            "request": "launch",
            "url": "http://127.0.0.1:8000/examples/livebuild/lapps.html",
            "webRoot": "/Users/name/Sites/LappsInternal/
        },
    ]

On exceuting .scripts from visual code says

-webpack://LAPPS/./src/app.js (/Users/name/Sites/LappsInternal/build/webpack:/LAPPS/src/app.js)

Any suggestion? There similar issue reported for visual-code in github but solutions not helping

4
  • update devtool config with devtool: 'cheap-module-eval-source-map' and then try Commented Mar 6, 2018 at 10:16
  • Hey Thanks, Its working :) Commented Mar 7, 2018 at 14:17
  • let me add this as an answer. Hope u will accept it and maybe upvote :p Commented Mar 7, 2018 at 14:18
  • 1
    Sure! Good news visual code is stoping at the line, however in the breakpoint list it says breakpoint set but not yet bound Commented Mar 7, 2018 at 14:24

1 Answer 1

1

update devtool config with devtool: 'cheap-module-eval-source-map'.

{
    'mode': mode,
    entry: {
        lapp: './src/app.js',
    },  
    devtool: 'cheap-module-eval-source-map',
    output: {
        path: path.join(__dirname, 'build'),
        filename: '[name].js',
        publicPath: "/build/",
        libraryTarget: 'umd',
        library: 'LAPP'
    }
},
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.