Attempted import error: 'Struct' is not exported from 'superstruct'.
Failed to compile.
./node_modules/@metamask/utils/dist/chunk-6C35XQOF.mjs Attempted import error: 'Struct' is not exported from 'superstruct'.
The build process failed in a file named chunk-6C35XQOF.mjs within the @metamask/utils package. The code in this file tries to import something called Struct from the superstruct library. However, superstruct doesn't provide a public export for Struct.
Hi @NishantPatil307, what kind of project do you have? Is it Node or TypeScript? Is your project ESM or CommonJS?
Im having this issue too with esm.
it's a react project that I try to setup with particle.network https://developers.particle.network/recipes/configuring-particle-auth-core
this current package appears to be a dependencies and throws this same error during build process
Hi @irzhywau, which version of this package are you using? We've been making some updates lately to resolve issues we've seen with superstruct. You should have better luck with at least 8.5.0 although 9.0.0 is preferred. Try either of those out and let us know.
Facing same issue even using 9.0.0 or 9.1.0
I want to give more insight here, it seems not working only in a create-react-app project, it seems working under a vite or next react project. This issue may not addressed to this package, it's more concerned about @metamask/superstruct. Here some related issue https://web3auth.io/community/t/we-are-facing-this-issue-while-running-this-from-the-app-attempted-import-error-struct-is-not-exported-from-metamask-superstruct/8418
I tried installing and running the app provided in that URL (https://github.com/mailgourav/Web3Auth) and was unable to reproduce this error.
If someone is able to provide me a repo that produces a bug I can look further into this.
In the meantime I am closing, but I will reopen if this is still a problem.