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.

Sourcemaps for Typescript files not displaying correctly in Chrome using Brunch 2.10.9

See original GitHub issue

Description

Building my Typescript project using brunch does not include correct sourcemapping in the browser anymore. I noticed this starts breaking in 2.10.0 (so I’m using 2.9.1 for now).

Expected behavior

I expect to see Typescript code when I open the mapped files in the browser for debugging.

Actual behavior

Chrome still shows .ts source files, but when I open them the content appears to be the transpiled .js files.

Environment

  1. Brunch: 2.10.9
  2. Node.js: 6.9.1
  3. NPM: 3.10.9
  4. Operating system: Windows 7
  5. Code editor: VSCode

package.json contents

{
  "name": "myapp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "my-other-app": "1.0.0-alpha005"
  },
  "devDependencies": {
    "brunch": "^2.10.8",
    "jasmine-core": "^2.5.2",
    "javascript-brunch": "^2.10.0",
    "less-brunch": "^2.10.0",
    "tslint": "^4.5.1",
    "typescript": "^2.2.1",
    "typescript-brunch": "^2.3.0",
    "uglify-js": "^2.8.12"
  }
}

brunch config contents

module.exports = {
    files: {
        javascripts: {
            joinTo: {
                'js/vendor.js': /^Website.UI\/libs\/vendor\//,
                'js/app.js': /^Website.UI\/app\//
            },
            order: {
                before: ['Website.UI/libs/vendor/angular.min.js']
            }
        },
        stylesheets: {
            joinTo: 'css/main.css'
        },
    },
    plugins: {
        brunchTypescript: {
          ignoreErrors: true
        }
    },
    paths: {
        watched: ['Website.UI\/app\/', 'Website.UI\/libs\/vendor\/', 'Website.UI\/less\/'],
        public: 'Website.UI\/public'
    },
    modules: {
        nameCleaner: (path) => path.replace(/^Website\.UI\/app\//, ''),
        autoRequire: {
            'js/app.js': ['app']
        }
    }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
shvaikaleshcommented, Mar 24, 2017

It is a well-known source maps issue caused by compiler chaining. Progress in #1664.

0reactions
fridaycommented, Oct 24, 2017

Perhaps #1757 solves this?

Update: Now released in v2.10.12

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source maps don't always map back to the original sources.
Description Source maps don't always map back to the original sources. Expected/Actual behavior Example repo: ...
Read more >
TypeScript source map files don't work with Chrome
1 and have source maps working correctly in Chrome. My source map begins {"version":3,"file":"pe.plugins.js","sources":[" ...
Read more >
source maps for typescript aren't loaded in developers tools
Typescript source files are not showing. I've tried with both Opera and Chrome (both have the same developers tools) but the result is...
Read more >
source-map-explorer
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 >
TypeScript debugging in Visual Studio with IE, Chrome and ...
You can't debug TypeScript code in Chrome or Firefox. Ugh. If you set a breakpoint in Visual Studio in a TypeScript file:.
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