Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jwt-authentication example #33

Closed
johnrackles opened this issue Nov 5, 2021 · 2 comments
Closed

jwt-authentication example #33

johnrackles opened this issue Nov 5, 2021 · 2 comments

Comments

@johnrackles
Copy link

When I try to run the example locally, I get:

error - node_modules/jose/dist/browser/jws/flattened/sign.js (11:0) @ new FlattenedSign
TypeError: payload must be an instance of Uint8Array
null

Oddly enough, when I deploy it everything seems to work fine. Any Ideas how that happens? I checked, both vercel and my local machine are on node 14.18.1

@panva
Copy link
Contributor

panva commented Nov 5, 2021

This is due to the vm module isolation, the Indexed collections are not shared between where your code requires/imports libraries and the middleware execution context.

I've opened an issue about it vercel/next.js#30477

This is only the case when running outside of Vercel's own Edge Network.

@johnrackles
Copy link
Author

For anyone stumbling upon this, it's fixed in v12.0.4-canary.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants