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.

Nginx exposes source maps in production

See original GitHub issue

INFO: solution from #1127 : npm run build angular configuration production adds source maps (*.js.map) to for PWA browser and SSR.

Actual Behavior If environment variable SOURCE_MAPS has one of the values 1, on, true or yes , then :

  • PWA exposes source maps in browser
  • PWA SSR exposes source maps to web clients, i.e. search engine crawler / robot (SEO) else
  • PWA exposes source maps in browser
  • PWA SSR exposes NO source maps

Expected Behavior If environment variable SOURCE_MAPS has one of the values 1, on, true or yes , then :

  • PWA exposes source maps in browser
  • PWA SSR exposes source maps to web clients, i.e. search engine crawler / robot (SEO) else
  • PWA exposes NO source maps in browser
  • PWA SSR exposes NO source maps

Steps to Reproduce the Bug

Steps to reproduce the behavior:

  1. Go to PWA Home Page
  2. Open Web Browser Dev Tools > Sources
  3. Search for typescript file api-token.ts. The search returns a search hit unexpectedly.

Environment Details

  • Desktop: *

    • OS: Windows 10
    • Browser: chrome / brave
    • Project Code Version : gib branch master on 31 May 2022

AB#77148

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jstein213commented, Jun 2, 2022

@shauke @dhhyi I confirm your test results. The bug is invalid and I close it.

1reaction
shaukecommented, Jun 1, 2022

Tested with docker-compose.yml configuration:

    environment:
      - LOGGING=on
      - SOURCE_MAPS=off

that resulted in image

I would say the exposing and not exposing of the source maps files works as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using sourcemaps on production without exposing the source ...
Sourcemaps can be easily configured with webpack, all you need to do is to set devTool property in your webpack.config.js to either 'sourcemap' ......
Read more >
Serving source maps in production | The Making of Close
Since we already have an Nginx container with source maps and production build, we can use that to serve source maps only for...
Read more >
tcp - Slow performance of Nginx when using Source Maps in ...
I have a problem with Nginx and source maps. I wanted to use them in production for debugging. They are not actually downloaded...
Read more >
Should I Use Source Maps in Production? | CSS-Tricks
A “source map” is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to the original authored version....
Read more >
Is there a way to remove sourcemap line in built assets? #1341
Is a nice way to remove the sourcemap line from the .js and .css ... Production deploy - How to remove/disable webpack source-map...
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