-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update "@coral-xyz/anchor" package to support ES Module format for workspace.js #2844
Comments
I notice that anchor/dist/esm are not using .mjs extension, and there is no |
i think the problem lies in esm/index.js can we change it to? we shouldnt be using require in esm right? seems like vitest is not allowing it
|
This is not correct as many projects in the Solana ecosystem use the You can check out the
Most bundlers support |
Currently using vitest and it fails as mentioned, i think they have some checks, the only way i can make it work is to change
I think this is an issue with vitest that is quite strict with mixing require and esm, but to make it more compatible, maybe we should make it consistent? Using require inside esm might cause some other bundles or frameworks to detect or reject it as an error |
Hi, I am currently using sveltekit and seem to be hitting this error. I don't seem to be able to fix it on my end and it seems like some misconfigured imports on the package. It looks like anchor can only be used on the backend nodejs? I currently have to split my code to make sure anchor doesnt get bundled or called from the frontend code else i get this error.
Not sure if its just a simple fix?
Thanks!
The text was updated successfully, but these errors were encountered: