codeswing icon indicating copy to clipboard operation
codeswing copied to clipboard

Cannot add library module in new React swing

Open fmaiabatista opened this issue 2 years ago • 3 comments

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.

  • I'm using the extension version v0.0.21 (latest)
  • I am trying in a brand new folder/workspace (called codeswing), and have initialized it as a CodeSwing by using Initialize Workspace as Swing, then chose Component: React.js
  • I get two files (App.jsx and codeswing.json) after that
  • And if I try to follow the steps of https://github.com/lostintangent/codeswing#external-libraries or https://github.com/lostintangent/codeswing#javascript-modules I don't get the same results (even the Add Library icon looks different?)

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

fmaiabatista avatar Nov 10 '22 11:11 fmaiabatista

Have the same issue. anyone know of a workaround?

jereloh avatar Aug 30 '23 14:08 jereloh

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/

tornadoblue avatar Sep 05 '23 01:09 tornadoblue

{"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.

rbspb avatar Sep 19 '23 05:09 rbspb

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

lostintangent avatar Mar 03 '24 19:03 lostintangent