swagger-api / swagger-api/swagger-ui

Invalid sourcemaps in dist/

Open
#5,598 1 comment 0 reactions 0 assignees View on GitHub

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
  • Browser: NA
  • Version: latest (master branch)
  • Method of installation: NA
  • Swagger-UI version: latest (master branch)
  • Swagger/OpenAPI version: NA
Describe the bug you're encountering

The .map files provided in the dist/ folder seem to be invalid, based on sourcemap-validator

To reproduce...

Steps to reproduce the behavior:

  1. Install the sourcemap-validate command:
    npm install -g git+https://github.com/Lucas-C/sourcemap-validator.git
  2. Execute the following command in this repo:
    sourcemap-validate dist/swagger-ui-bundle.js dist/swagger-ui-bundle.js.map
Expected behavior

Validation OK

Additional context or thoughts

Using sourcemap-validate I tested that the Validation OK message appears up to tag v3.3.0. Starting from tag v3.4.0 the error appears.

I found about this error in https://github.com/springfox/springfox/issues/3114, because my Firefox browser could not load the sourcemaps correctly.

Based on the package-lock.json in this repo I cannot pinpoint exactly what version of webpack-sources it is using, but this error may be due to a nasty bug broke sourcemaps it generated before version 1.4.1

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 running sourcemap-validate against dist/swagger-ui-bundle.js and dist/swagger-ui-bundle.js.map, then inspect package-lock.json and the build configuration for the webpack-sources version used since v3.4.0. Done means the generated .map files validate successfully and the command reports "Validation OK".

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.