tim-lai / parcel-swagger-ui

SwaggerUI built with Parcel
MIT License
0 stars 0 forks source link

SwaggerUI does not render #1

Open tim-lai opened 2 years ago

tim-lai commented 2 years ago

The main branch renders a working “Hello World” React app. It includes as a dependency but does not directly import swagger-ui.

Atm, the feat/babel branch imports swagger-ui but does not render. The feat/babel branch represents current investigation into adding Babel transpiler, but may not be the correct path to a solution of the immediate issue. The theory was that Parcel 2.x needed additional polyfills and/or Babel transpiliation.

From this screenshot, if Babel is not the solution, there may be an issue with SwaggerUI, specifically looking at the memoizeN.js file.

parcel-swagger-ui-error-01

Additionally, if one comments out this line: https://github.com/tim-lai/parcel-swagger-ui/blob/f538c8e6ea099f114e165f38113c32216248de59/src/App.js#L1 one can reproduce the error above. Note that this line change simply imports swagger-ui, and does not yet instantiate a SwaggerUI instance.

Sidenote, importing css from SwaggerUI library also has errors. This is true if loading directly in html or in the javascript code.

Additionally, I tried using Parcel 1.x, which introduced a whole set of different issues, especially with outdated dependencies. Parcel 2.x was released in Oct'21, and we should probably use it in new projects.

tim-lai commented 2 years ago

I also tried adding additional alias and installing known polyfills from swagger-ui and swagger-editor projects, which are not reflected in the feat/babel branch.