twbs / twbs/bootstrap

Production build should not reference sourcemaps

Open
#41,810 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

The production builds reference sourcemaps due to trailing comments.

bootstrap.bundle.min.js:

//# sourceMappingURL=bootstrap.bundle.min.js.map

bootstrap.min.css:

/*# sourceMappingURL=bootstrap.min.css.map */

That unfortunately spams the devtools console on every page load. Example from my dev machine::

Source map error: Error: request failed with status 404
Resource URL: http://localhost:80/bootstrap.min.css
Source Map URL: bootstrap.min.css.map

The production build should not have source map support, because it's unnecessary, it spams the console and generates significantly more traffic. (CDN-served assets also have sourcemaps in production builds.)

Reduced test cases
  • Reference minified css and js files, either from local sources or CDN
  • Open devtools console - errors
  • Measure traffic - much more traffic as those map files are huge
What operating system(s) are you seeing the problem on?

Linux, iOS, Android, Windows, macOS

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

v5.3.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting how the production assets bootstrap.bundle.min.js and bootstrap.min.css are generated, then compare their trailing sourceMappingURL comments with the reported console behavior. Verify the built local and CDN-served files no longer reference sourcemaps and that loading them does not request the .map files or produce source-map errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.