equal-aqua
equal-aqua2y ago

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.
No description
21 Replies
kapa.ai
kapa.ai2y ago
Hi @rasitcolakel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai2y ago
---------------------- 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
kapa.ai
kapa.ai2y ago
<@698992415486246944> kapa.ai is still learning and improving, please let us how it did by reacting below
sensitive-blue
sensitive-blue2y 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.
equal-aqua
equal-aqua2y 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
sensitive-blue
sensitive-blue2y 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
equal-aqua
equal-aqua2y 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
sensitive-blue
sensitive-blue2y ago
i will debug and return you. Thanks for the issue
equal-aqua
equal-aqua2y ago
I guess I found the problem. If it works, i will let you know.
sensitive-blue
sensitive-blue2y ago
Thank you 🥹
equal-aqua
equal-aqua2y 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/
sensitive-blue
sensitive-blue2y ago
You are awesome 👍😎
equal-aqua
equal-aqua2y 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...
equal-aqua
equal-aqua2y ago
When I remove the code block, the app renders but it does not get data from next api
No description
equal-aqua
equal-aqua2y ago
When I do not remove the code block. It throws
No description