lostintangent / codeswing

VS Code extension for building web applications ("swings") using a interactive and editor-integrated coding environment
https://aka.ms/codeswing
MIT License
977 stars 46 forks source link

Cannot add library module in new React swing #75

Closed fmaiabatista closed 5 months ago

fmaiabatista commented 1 year ago

Hi, I'm having issues getting the basic import of a library in a brand new React swing.

If I use the Add Library > Script module function, I will get no search results. If I use the Add Library > Script function, then the search works fine and I get results for my search.

https://user-images.githubusercontent.com/1574224/201077858-6d7c3903-7e14-433f-aa5b-fd9b91200169.mp4

jereloh commented 12 months ago

Have the same issue. anyone know of a workaround?

tornadoblue commented 11 months ago

I had same issue today so I inspected the method that is failing to give results:

// src/preview/libraries/skypack.ts
async function getModules(searchString: string) {
  const librariesResponse = await axios.get<{ results: SkypackPackage[] }>(
    `https://api.skypack.dev/v1/autocomplete_package?q=${searchString}`
  );

  return librariesResponse.data.results;
}

The issue (for me anyways) appears to be with Skypack's API throwing a 503 server error response.

https://api.skypack.dev/v1/autocomplete_package?q=conf

{"error":"error","message":"HTTPError: Response code 503 (Service Unavailable)"}

Could just be that the server is having intermittent issues and this sometimes works and other times doesn't, I'll try again in a few days and contact the dev listed in the Swagger API notes for https://api.skypack.dev/

rbspb commented 11 months ago

{"error":"error","message":"HTTPError: Response code 503 (Service Unavailable)"}

Could just be that the server is having intermittent issues and this sometimes works and other times doesn't, I'll try again in a few days and contact the dev listed in the Swagger API notes for https://api.skypack.dev/

No response from Skypack team and the status page says it's been down for 10 months, think it is time to move to a new ESM package host that has a search API.

lostintangent commented 5 months ago

This is fixed in 0.0.23, so if you update from the marketplace, you should be good to go. Thanks!