-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to deploy to Netlify SSR #7920
Comments
This is a bundling issue. // astro.config.mjs
defineConfig({
vite: {
ssr: {
external: ['jsonwebtoken']
}
}
}) You may need some additional configuration to exclude |
Tried it with // astro.config.mjs
defineConfig({
vite: {
ssr: {
external: ['jsonwebtoken', 'bcrypt'],
}
}
}) Still facing same issue Also tried with #netlify.toml
[functions]
external_node_modules = ["jsonwebtoken", "bcrypt"]
still no luck. |
TL;DR: I recommend swapping out "Could not resolve crypto" error seems to be during the Astro build step, by adding this to package.json, it seemed to resolve the error for me. "browser": {
"crypto": false,
"stream": false,
"util": false
}, At this point, you can technically
It seems we may have discovered a bug with the Netlify adapter that by default when you have a And because But as mentioned above, you can also manually build and remove the edge functions folder and deploy to Netlify and it should work as expected with Hope that helps! |
Thanks for the detailed response @reaganchisholm! Seems like Unfortunately, Astro can't support every kind of package in every kind of environment, so I'm going to close this issue and recommend opening an issue with |
What version of
astro
are you using?2.9.7
Are you using an SSR adapter? If so, which one?
Netlify
What package manager are you using?
pnpm
What operating system are you using?
MacOS
What browser are you using?
Chrome
Describe the Bug
I have a following configs
I have a middleware, in which I try to validate JWT using
jsonwebtoken
package.This is working fine with
astro dev
.But when I try deploying this to netlify, I am getting the following error:
What's the expected result?
I should be able to deploy to Netlify.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rawcyg?file=astro.config.mjs&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: