awslabs/aws-jwt-verify

[vite]: Rollup failed to resolve import "#node-web-compat"

jrowen opened this issue · 2 comments

I'm trying to include this library in a Vue 3 project using vite build but seeing the following error.

[vite]: Rollup failed to resolve import "#node-web-compat" from "node_modules/aws-jwt-verify/dist/esm/jwt-rsa.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

Is this expected, and if so, is there a recommended workaround to allow vite to accept this package?

Last I checked, Rollup needs a bit of extra config to make sense of the subpath import. See here: https://github.com/awslabs/aws-jwt-verify/blob/main/tests/vite-app/vite.config.ts

That's what I needed, thanks.