Next Js on Vercel
Hi, after deploying my app on vercel, there is no error while deploying. But I visit the app it throws 504 error. The error is "undefined INFO info - Loaded env from /var/task/.env". What can I do to solve this problem? I tried Netlify and AWS Amplify too.
21 Replies
Hi @rasitcolakel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the refine documentation and blog posts for more information on deploying your app:
- Deploying your app to the web using Netlify (https://refine.dev/docs/tutorial/getting-started/deploy-project)
- Deploying a refine app using Vercel (https://refine.dev/blog/refine-vs-redwood-js/)
If you still face issues, consider reaching out to the respective hosting service's support or community forums for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------6. Deploying your app to the web | refine
To make your app accessible to the public, you can use a hosting service to build and deploy your site live on the web. In this tutorial, we will use Netlify, but you are welcome to choose your preferred hosting service.
refine vs RedwoodJS | refine
We will compare two open source React frameworks, that can be used to build CRUD applications
<@698992415486246944> kapa.ai is still learning and improving, please let us how it did by reacting below
conscious-sapphire•2y ago
refine Deployment process should not any different from any nextjs app. I suggest you you to double check your code.
This example working fine on vercel:
https://with-refine.vercel.app
https://github.com/alicanerdurmaz/with-refine
If you share your code and with us, i will happy to debug
GitHub
GitHub - alicanerdurmaz/with-refine
Contribute to alicanerdurmaz/with-refine development by creating an account on GitHub.
optimistic-goldOP•2y ago
Thanks Alican, I am checking your repo now. I will let you know about the process.
Do you have any example with i18n works with next js? I guess it is about the i18n
conscious-sapphire•2y ago
GitHub
refine/examples/i18n-nextjs at next · refinedev/refine
Build your React-based CRUD applications, without constraints. - refine/examples/i18n-nextjs at next · refinedev/refine
optimistic-goldOP•2y ago
Checking the example
I have deployed the app(https://i18n-nextjs-next-js.vercel.app/posts) It throws error like:
react-i18next:: You will need to pass in an i18next instance by using initReactI18next
Error: ENOENT: no such file or directory, scandir '/var/task/public/locales/en'
at Object.readdirSync (node:fs:1452:3)
at getLocaleNamespaces (/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:175:23)
at /var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:181:20
at Array.map (<anonymous>)
at getNamespaces (/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:180:44)
at createConfig (/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:221:29)
at _callee$ (/var/task/node_modules/next-i18next/dist/commonjs/serverSideTranslations.js:199:53)
at tryCatch (/var/task/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:44:17)
at Generator.<anonymous> (/var/task/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:125:22)
at Generator.next (/var/task/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:69:21) {
errno: -2,
syscall: 'scandir',
path: '/var/task/public/locales/en',
page: '/en/images/flags/undefined.svg'
}
RequestId: f3c59618-5d5d-43e0-8fd3-7287369c82bd Error: Runtime exited with error: exit status 1
Runtime.ExitError
conscious-sapphire•2y ago
i will debug and return you. Thanks for the issue
optimistic-goldOP•2y ago
I guess I found the problem. If it works, i will let you know.
conscious-sapphire•2y ago
Thank you 🥹
optimistic-goldOP•2y ago
BTW, when I build my project with docker-compose on local. It works. But It does not work on vercel, netfliy etc.
I have solved the problem. If it is ok for you, I want to open a PR on the refine repo 🙂
https://i18n-nextjs-next-js.vercel.app/
conscious-sapphire•2y ago
You are awesome 👍😎
optimistic-goldOP•2y ago
I have created the PR, you can check it: https://github.com/refinedev/refine/pull/4227
GitHub
It Solves "react-i18next:: You will need to pass in an i18next inst...
This pull request fixes the error below
react-i18next:: You will need to pass in an i18next instance by using initReactI18next
Error: ENOENT: no such file or directory, scandir '/var/task/publi...
optimistic-goldOP•2y ago
When I remove the code block, the app renders but it does not get data from next api
optimistic-goldOP•2y ago
When I do not remove the code block. It throws
optimistic-goldOP•2y ago
Here is the demo: https://sozvarligi-ui.vercel.app/languages
Here is a custom endpoint for api: https://sozvarligi-ui.vercel.app/api/languages
conscious-sapphire•2y ago
i will look into it
optimistic-goldOP•2y ago
I have solved the problem. Thanks for your help. It was about the Vercel. My plan was hobby. To solve this problem I needed to upgrade my plan.
conscious-sapphire•2y ago
I'm glad to hear that 🚀
Thank you for letting me know
fair-rose•2y ago
Hello, any progress regarding this issue?
conscious-sapphire•2y ago
when you update latest version, i believe it will solve the problem.
you can use https://refine.dev/docs/packages/documentation/cli/#check-updates