-
Notifications
You must be signed in to change notification settings - Fork 84
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
Next.js app fails during build with Error: DAPR_SIDECAR_COULD_NOT_BE_STARTED #566
Comments
Hi @xendren, if it's a front-end application then the SDK won't work. It needs a Node runtime. Also
Could you share what commands you're using to start the app (with SDK) and sidecar, and share a minimum reproducible example with logs? Also curious to know, what is this next.js project? |
This is a react app using Next.js framework. This error is occurring during the "next build" command to prepare for deployment, so this isn't even at runtime. Next.js appears to be executing code during the build optimization process. I have tried installing the Dapr CLI and runtime during the build, but it gets the same error. Oddly, it will only pass the build process if the sidecar is actually running. I'm guessing the Next.js optimization process is doing something it shouldn't. I posted this question in hopes that someone might have some ideas. Our next thing to try is to switch to making the sidecar calls without using the dapr js-SDK, but I was hoping to avoid that if possible. |
For anyone else that encounters this problem, we were able to solve it by moving the Dapr client logic to the instrumentation.js source and enabling the instrumentation feature in the Next.js configuration. This feature is used to execute server side code once at startup. Here is a link to the Next.js docs on instrumentation. |
Ask your question here
We are using Next.js for building our react application. We have followed the JavaScript SDK examples for fetching secrets using the Dapr SDK. Everything is working fine in standalone mode, but we are getting the error below when running next build. It appears to be awaiting the sidecar to startup during the build for some reason. I'll post the question on Next.js project as well.
Any help would be appreciated.
"Error: DAPR_SIDECAR_COULD_NOT_BE_STARTED"
The text was updated successfully, but these errors were encountered: