Custom registry CORS error

Getting a CORS error when trying to use a custom shadcn registry

Access to fetch at ‘https://esm.v0.dev/@wix/wix-ui-icons-common@^3.81.0/system/?target=es2022’ from origin ‘https://preview-open-in-v0-kzmpb8y9fanucsag1np2.vusercontent.net’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.Understand this error
5359-54632197b7792ecd.js?dpl=dpl_Gq2Dv5mcAYjvT1YTF5hefREHwShU:1 GET https://esm.v0.dev/@wix/wix-ui-icons-common@^3.81.0/system/?target=es2022 net::ERR_FAILED 308 (Permanent Redirect)

This appears to be caused by the redirect removing the trailing slash after system/?, I’ve flagged to the team to investigate

Do you have a trailing slash at the end of your import like this? If so that’s probably the culprit and should be able to fix by removing it

import { SomeSystemIcon } from '@wix/wix-ui-icons-common/system/';

Otherwise this is likely on our end and will have to wait for the fix, in the meantime you might have success switching to their old package or using a different icon library temporarily

2 Likes

Thanks for the quick reply @jacobparis!

I’ll have a look at our code to see if there’s trailing slash imports.