Missing UI files (when NPM install is not run)
amul047 opened this issue · comments
I ran the Streetlights example API, and attempted to visit /asyncapi/ui/ for the UI.
However, it seems that two files referenced from the index.html are missing - index.js
and default.min.css
. The former appears to be leading to this error.
index.html:14 Uncaught ReferenceError: AsyncApiStandalone is not defined
at index.html:14
(anonymous) @ index.html:14
These files need to be installed/restored from NPM.
I opted not to automatically run npm install
from MSBuild so that the .NET project could be built without needing to install NodeJS & NPM.
The CI/CD workflows do this automatically:
https://github.com/tehmantra/saunter/blob/fcfe05f6045d2f49473b262e87e157bede630d12/.github/workflows/ci.yaml#L27
And there is a unit test to check that the resource exists:
https://github.com/tehmantra/saunter/blob/fcfe05f6045d2f49473b262e87e157bede630d12/test/Saunter.Tests/UI/EmbeddedResourceTests.cs#L17
I'm not sure how to make the developer experience better here?
Perhaps having instructions in the README to use NPM if you want to test the UI?
What would have helped you most in this scenario?
Thanks for your help, just an update to the example README.md would be useful. It only talks about dotnet run
at the moment.