Hi,
We are trying to bundle our library that uses web3auth packages, but unfortunately the cjs bundle of @web3auth/auth is broken.
It is trying to require a ESM only package called color.
It is required in this file @web3auth/auth/dist/lib.cjs/core/auth.js.
I checked your bundling tool and I think you have to avoid color package to be external in rollup configuration (rollup used to bundle the cjs file).
So rollup will transform this ESM only package to CJS format.
Issue: When bundling your library, the CJS bundle of @web3auth/auth is attempting to require the “color” package, which is ESM-only. This breaks the build process.
Next Steps / Questions
To help us investigate further, could you please provide:
SDK Version Number: Which version of @web3auth/auth are you using?
Bundler Details: Which bundler (Webpack, Vite, etc.) and version are you using for your library?
Error Output: If possible, please share the specific error message or stack trace from your build process.
Minimal Reproduction: If you have a minimal code snippet or repo that reproduces the issue, that would be very helpful.
Once you provide the requested details, our team will be able to assist you more effectively. Thank you for your patience!
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours