question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect sourceMappingURL added to generated server bundle prevents debugging

See original GitHub issue

Updated my gist with patch to use sourcemap: 'inline'. This solves the issue.

Here’s the gist: https://gist.github.com/kiliman/a9d7c874af03369a1d105a92560d89e9

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
connor4312commented, Mar 26, 2022

By the way, you can also make breakpoints work by doing something like this in your launch.json within VS Code:

    {
      "type": "node-terminal",
      "request": "launch",
      "name": "Launch Server",
      "command": "npm run dev:remix",
      "skipFiles": ["<node_internals>/**"],
      "sourceMapPathOverrides": {
        "route:*": "*" // <-- fix up the paths, so route:<path> just becomes <path>
      },
      "outFiles": ["${workspaceFolder}/build/**/*.js"]
    },

    {
      "name": "Launch Client",
      "request": "launch",
      "type": "msedge",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}/public/build" // tell the debugger that relative sourcemaps paths should be resolved from here
    }

Aside from having to fix the route: this is fairly ‘idiomatic’, though not easy to discover unless you’re a sourcemapexpert… https://github.com/microsoft/vscode-js-debug/issues/1214

1reaction
kilimancommented, Apr 29, 2022

@heiso Are you on the latest Remix? Sourcemaps should automatically generate in development. You have to opt-in to sourcemaps for production remix build --sourcemap

They removed the sourcemap option in remix.config

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code: "Breakpoint ignored because generated code not ...
I solved my problem by changing .vscode/launch.json so that ... is to turn on debugging trace by adding the following line in launch.json....
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
Source maps are awesome. Namely, because they are used to display your original JavaScript while debugging, which is a lot easier to look...
Read more >
source-map-explorer - npm
Analyze and debug JavaScript (or Sass or LESS) code bloat through source maps. The source map explorer determines which file each byte in ......
Read more >
Stop Painful JavaScript Debug and Embrace Intellij ... - Medium
Webpack can generate source map for a production environment in an optimized way. The debug configuration in IntelliJ is a bit different with...
Read more >
Showing full stacktraces - Bugsnag docs
In addition to standard bundles, the Random Access Modules (RAM) bundle ... maps used for the debug variant can be downloaded from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found