swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26k stars 8.86k forks source link

CSS source map is broken #9946

Open kaiyoma opened 1 month ago

kaiyoma commented 1 month ago

Q&A (please complete the following information)

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:

  1. Have a webapp built with Vite and postcss (we use LESS) and swagger-ui-react
  2. Import the stylesheet: @import 'swagger-ui-react/swagger-ui.css';
  3. 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

romainmenke commented 1 month ago

Repro : https://github.com/romainmenke/issue-1914-sourcemaps