ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.52k stars 782 forks source link

Add Source-Maps #1255

Closed mmakrzem closed 5 years ago

mmakrzem commented 5 years ago

Stencil version:

 @stencil/core@0.15.2

I'm submitting a:

[] bug report [X] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior: I'm using the stencil starter project found here (https://github.com/ionic-team/stencil-component-starter) and I would like to debug the code in visual studio code. The following configuration lets me launch chrome from within visual studio code:

"configurations": [
 {
  "type": "chrome",
  "request": "launch",
  "name": "Launch Chrome against localhost",
  "url": "http://localhost:3333",
  "sourceMaps": true,
  "webRoot": "${workspaceFolder}/www"
 }
]

Expected behavior: When I place a breakpoint in visual studio code, I expect execution to stop there. This doesn't happen. Instead I get a warning saying 'unverified breakpoint' for all the breakpoints I place in the code.

Dohxis commented 5 years ago

I have the same problem

tricki commented 5 years ago

See my answer on StackOverflow, specifically the part about source maps:

But since Stencil does not generate source maps yet you will only be able to debug the compiled code. Source: https://github.com/ionic-team/stencil/issues/219

My method for finding the correct generated file is to just add a debugger; statement so that VS Code will automatically break.

ggretz commented 5 years ago

any update on this? is it maybe also possible to debug unit tests / e2e tests? edit: after playing around with some settings, i found out how to debug tests. It even maps the ts code correctly. Here is my configuration:

{
    "type": "node",
    "request": "launch",
    "name": "Test",
    "program": "${workspaceFolder}/node_modules/@stencil/core/bin/stencil",
    "args": [
        "test",
        "--spec",
        "--e2e",
        "--runInBand"
    ],
    "console": "integratedTerminal",
    "internalConsoleOptions": "neverOpen",
    "disableOptimisticBPs": true
}
jthoms1 commented 5 years ago

Sourcemaps are something we plan to add to the roadmap. I will leave this issue open as the reference for implementing them.

ionitron-bot[bot] commented 5 years ago

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

tehdb commented 5 years ago

still no source-maps? 😭

leoafarias commented 5 years ago

Just a bump for this.. seems like an important feature

ionitron-bot[bot] commented 5 years ago

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

splitinfinities commented 2 years ago

Heads up everyone, Stencil supports sourcemaps as of v2.9.0! https://stenciljs.com/docs/config#sourcemap