MetaMask / utils

Various JavaScript / TypeScript utilities of wide relevance to the MetaMask codebase.
https://metamask.github.io/utils/index.html
ISC License
30 stars 9 forks source link

Attempted import error: 'Struct' is not exported from 'superstruct'. #177

Open NishantPatil307 opened 6 months ago

NishantPatil307 commented 6 months ago

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.

mcmire commented 5 months ago

Hi @NishantPatil307, what kind of project do you have? Is it Node or TypeScript? Is your project ESM or CommonJS?

irzhywau commented 2 months ago

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

mcmire commented 2 months ago

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.

hasiniainawau commented 1 month ago

Facing same issue even using 9.0.0 or 9.1.0 image

hasiniainawau commented 1 month ago

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