Serverless-webpack: sourceMaps question

Created on 12 Apr 2018  路  3Comments  路  Source: serverless-heaven/serverless-webpack

This is a question

Description

I am using the babel-webpack-4 example config with sourcemaps.
The package.json debug script looks like this:

node --inspect-brk ./node_modules/.bin/serverless offline start

With this, chrome debugger breaks at the correct place, I can see the correct source file name in the open tab, the call stack looks good but the source file is empty. I can open all source files in the left "Network" pane, but they are all empty.

Is this expected to work?
I've confirmed that the same config can be debugged just fine with VSCode.
Also, I've confirmed that chrome debugging works as expected without source map support.

Thanks!

  • Serverless-Webpack Version you're using:
    5.1.1
  • Webpack version you're using:
    4.5.0
  • Serverless Framework Version you're using:
    1.26.1
  • Operating System:
    macos, Chrome 65
  • Stack Trace (if available):
question

All 3 comments

Hi @bebbi . I'm using only VSCode where it works perfectly. But I remember that VSCode only started to work after I had set the outFiles correctly to the .webpack folder in the launch.json (see the file in the babel webpback 4 example).
I assume that for Chrome also some option has to be set, so that it uses the .webpack folder as root for resolution of the references in the source maps. Otherwise Chrome might try to reference the original source code which, of course is not available in the process space. However, I have no specific experience for that case with Chrome.

Thanks! Am going to check this out or otherwise use VSCode.

Actually, simply changing the webpack config

nosources-source-map -> eval-source-map

did the job..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tommedema picture tommedema  路  4Comments

jmparsons picture jmparsons  路  5Comments

deftomat picture deftomat  路  5Comments

hassankhan picture hassankhan  路  3Comments

taschmidt picture taschmidt  路  4Comments