You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to use the package @alchemy/aa-signers into my Vite app but whenever I try to use an export (in my case Web3AuthSigner) from the package I get the following error:
Failed to resolve entry for package "@alchemy/aa-signers". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@alchemy/aa-signers" package
I've noticed a closed ticket with this same error message mentioning to check with the publint.dev tool if all of the exports were correct, and they are. https://publint.dev/@alchemy/[email protected]
aa-signers documentation also mentions the alternative import "@alchemy/aa-signers/web3auth" that's also not being recognized as valid, in this case I get this error [plugin:vite:import-analysis] Failed to resolve import "@alchemy/aa-signers/web3auth" from "src/hooks/useConnectUser.tsx". Does the file exist?
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
It may be that thepackage.json module of @alchemy/aa-signers is configured with an exports field, but does not provide a "." in the exports field. Causing the resolve.exports to be unable to find the entry point and report an error.
The exports field has the highest priority. If exports is configured in package.json but not specified with ".", an error will occur because the entry point cannot be determined. I think this is an improper practice in itself, and it's not Vite's problem.
Yeah, what @XiSenao mentioned above is correct. Perhaps publint could add a check for this case.
aa-signers documentation also mentions the alternative import "@alchemy/aa-signers/web3auth" that's also not being recognized as valid, in this case I get this error [plugin:vite:import-analysis] Failed to resolve import "@alchemy/aa-signers/web3auth" from "src/hooks/useConnectUser.tsx". Does the file exist?
I tried this in the repro, and it seems to be working for me. I wrote the import like this:
But then, I now got a runtime browser error of ReferenceError: Can't find variable: global, but that's a different issue which I think you can find around the web too. global doesn't exist in browsers.
I'll close this issue for now as it seems to be a library packaging error, but feel free to follow up with any questions.
Describe the bug
I've been trying to use the package @alchemy/aa-signers into my Vite app but whenever I try to use an export (in my case Web3AuthSigner) from the package I get the following error:
Failed to resolve entry for package "@alchemy/aa-signers". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@alchemy/aa-signers" package
I've noticed a closed ticket with this same error message mentioning to check with the publint.dev tool if all of the exports were correct, and they are.
https://publint.dev/@alchemy/[email protected]
aa-signers documentation also mentions the alternative import "@alchemy/aa-signers/web3auth" that's also not being recognized as valid, in this case I get this error
[plugin:vite:import-analysis] Failed to resolve import "@alchemy/aa-signers/web3auth" from "src/hooks/useConnectUser.tsx". Does the file exist?
Reproduction
https://stackblitz.com/edit/vitejs-vite-thymym
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: