Chrome: SourceMap links not working
See original GitHub issueHi there,
loving this library, using it every day with pure joy! 😃
One of the coolest features might be the generated links to jump directly to the source. For some reason, that doesn’t work for me. Clicking on one of the links just opens a new tab to about:blank instead:
(after clicking on the link)
Manually, I can open the file in the DevTools just fine:
Angular version 13.0.2: ngx-logger version: 5.0.7 Chrome version: 97.0.4692.99 (running in debug mode without any plugins enabled)
Configuration (in app.module.ts):
imports: [
...
HttpClientModule,
LoggerModule.forRoot({
level: environment.production ? NgxLoggerLevel.INFO : NgxLoggerLevel.DEBUG,
serverLogLevel: NgxLoggerLevel.OFF,
timestampFormat: 'HH:mm:ss.SSS',
enableSourceMaps:true
})
]
- I started angular dev environment with
ng serve
Build config from angular.json:
{
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"stylePreprocessorOptions": {
"includePaths": [
"src/styles"
]
},
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
}
Did I miss something?
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
chrome, source map not loading - Stack Overflow
For chrome, source-map was not loading/working for me too. I kept on seeing the bundle.js files. However, in other browsers it worked, ...
Read more >source maps are not working when debugging with chrome
Version: 6.3.1 + Platform: OSX I am debugging my mocha tests using native node debugger, using the following command: /usr/local/bin/node ...
Read more >The source maps don't work in Developer Tools when ...
When I run on the iOS device Safari has no problem extracting the source map and I can debug correctly. Here's the screen...
Read more >4 Reasons Why Your Source Maps are Broken - Sentry Blog
Missing original source files This likely means that your source map doesn't contain or link to your original source files. Without your ...
Read more >Sourcemap not working - Help - OpenFL Community
I've checked the .map file and I can see "sourceRoot":"file:///", so the URL of the files should be file ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works for me:
Extend the NGXLoggerWriterService and replace prepareMetaString with your own implementation that removes the leading “.” and adds ‘webpack://’.
Configure ngx-logger to use it:
Maybe there is a better way, but this works (at least on my machine 😄 ) How I came up with
webpack://
? Thats what I saw, when hovering over the source of console.log statements:Sample output:
This works!! So many thanks!
So together with the fix for the missing linebreak before the actual message the writer should look like this:
(For some reason there is still an additional space added before the start of the actual message but it’s already way more readable).