swagger-api / swagger-api/swagger-ui
CSS source map is broken
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Windows 11
- Browser: Chrome
- Version: 125
- Method of installation: npm
- Swagger-UI version: 5.17.10
Describe the bug you're encountering
The postcss project recently added some extra CSS source map checks (to look for broken source maps) and the source map that is distributed with swagger-ui-react is evidently broken. When loading the stylesheet with the latest postcss, this warning appears:
VITE v4.5.0 ready in 2298 ms
➜ Local: http://localhost:3001/
➜ Network: use --host to expose
➜ press h to show help
original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
To reproduce...
Steps to reproduce the behavior:
- Have a webapp built with Vite and postcss (we use LESS) and swagger-ui-react
- Import the stylesheet:
@import 'swagger-ui-react/swagger-ui.css'; - Start Vite
Expected behavior
No warnings.
Additional information
For more information and a long discussion about this issue, see https://github.com/postcss/postcss/issues/1914
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the distributed swagger-ui-react/swagger-ui.css source map and reproduce the warning in a Vite app using PostCSS and the stylesheet import shown in the issue. Trace how the CSS asset and map are generated, then verify that loading it produces no source-map warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100