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

Unhandled Runtime Error Error: Error: [object Object] #207

Open
bhaveshselarka opened this issue Nov 25, 2023 · 13 comments
Open

Unhandled Runtime Error Error: Error: [object Object] #207

bhaveshselarka opened this issue Nov 25, 2023 · 13 comments

Comments

@bhaveshselarka
Copy link

⚠ metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:8000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
⨯ { error: 'fetch failed' }
⨯ [Error: Error: [object Object]] { digest: '193452068' }
⚠ ./node_modules/@medusajs/utils/dist/common/get-config-file.js

SCR-20231125-nrwk
@Dalvae
Copy link

Dalvae commented Dec 8, 2023

I have the same problem, how do you solve it?

@heejinp
Copy link

heejinp commented Dec 12, 2023

I am having the same issue, did u solve? the error message is the same but with "Next.js (14.0.0) out of date"

image

@molavec
Copy link

molavec commented Dec 14, 2023

In my case, Next required data from API (provided for another service in my localhost).
Compile fails with this error if the service is not up.

@salvinoto
Copy link

In my case, Next required data from API (provided for another service in my localhost). Compile fails with this error if the service is not up.

Could you explain this more please, I'm trying to figure this out myself

@DouglasMontoya
Copy link

In my case, Next required data from API (provided for another service in my localhost). Compile fails with this error if the service is not up.

Could you explain this more please, I'm trying to figure this out myself

He means that you have to create the storefront but with the medusa backend running. I tried it like this and it worked for me.

@salvinoto
Copy link

In my case, Next required data from API (provided for another service in my localhost). Compile fails with this error if the service is not up.

Could you explain this more please, I'm trying to figure this out myself

He means that you have to create the storefront but with the medusa backend running. I tried it like this and it worked for me.

I see, what if I'm hosting it on railway? I tried putting the railway url under NEXT_PUBLIC_MEDUSA_BACKEND_URL, got nothing tho

@SharadKumar
Copy link

Errors: metadata.metadataBase is not set for resolving social open graph or twitter images
They are fixed by exporting metadataBase from app/layout.tsx.

I sitll get failure with Vercel deployment:

Collecting page data ...
15:29:43.125 | Generating static pages (0/17) ...
15:29:43.470 | ⚠ Entire page /404 deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /404
15:29:43.475 | Generating static pages (4/17)
15:29:43.727 | ⚠ Entire page /checkout deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /checkout
15:29:43.728 | Generating static pages (8/17)
15:29:43.867 | ⚠ Entire page /account/orders deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/orders
15:29:43.868 | ⚠ Entire page /account deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account
15:29:43.868 | ⚠ Entire page /account/addresses deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/addresses
15:29:43.913 | Generating static pages (12/17)
15:29:43.913 | ⚠ Entire page /account/profile deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/profile
15:29:43.913 | ⚠ Entire page /cart deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /cart
15:29:43.946 | ⚠ Entire page /account/login deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/login
15:29:43.952 | ⚠ Entire page /store deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /store
15:29:43.967 | ⚠ Entire page / deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /
15:29:43.969 | { error: 'fetch failed' }
15:29:43.989 | { error: 'fetch failed' }
15:29:43.989 |  
15:29:43.989 | Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
15:29:43.989 | [object Object]
15:29:43.994 | ✓ Generating static pages (17/17)
15:29:44.008 |  
15:29:44.009 | > Export encountered errors on following paths:
15:29:44.009 | /(main)/page: /
15:29:44.096 | error Command failed with exit code 1.
15:29:44.097 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
15:29:44.113 | Error: Command "yarn run build" exited with 1

Although locally I see not problem with yarn build:

 Linting and checking validity of types    
 ✓ Collecting page data    
   Generating static pages (0/17)  [    ] ⚠ Entire page /404 deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /404
 ⚠ Entire page /account/login deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/login
 ⚠ Entire page /account/orders deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/orders
 ⚠ Entire page /cart deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /cart
 ⚠ Entire page /account deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account
 ⚠ Entire page /checkout deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /checkout
 ⚠ Entire page /account/profile deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/profile
 ⚠ Entire page /account/addresses deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /account/addresses
   Generating static pages (1/17)  [=   ] 
 ⚠ Entire page /store deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /store
 ✓ Generating static pages (17/17) 
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

@SharadKumar
Copy link

ok the issue was just env var not being properly set in Vercel, as I had integrated Railway and overlooked one of the var was still missing in Vercel project!

@Kofi-Emma
Copy link

ok the issue was just env var not being properly set in Vercel, as I had integrated Railway and overlooked one of the var was still missing in Vercel project!

Having the same problem, which env did you not properly set in Vercel?

@denisfelst
Copy link

denisfelst commented Mar 19, 2024

@SharadKumar what var was it? Would have helped to mention it.

@Kofi-Emma Did you solve it / find the var?

@denisfelst
Copy link

@salvinoto did you solve this?

@denisfelst
Copy link

@olivermrbl Hey Oliver, any idea what this could be? I'm stuck with this and having exactly the same issue as @SharadKumar on Vercel deployment (not locally)

@VariableVic
Copy link
Collaborator

VariableVic commented Mar 25, 2024

Hey @denisfelst - like others mentioned, errors like this usually indicate a failing connection to the Medusa server. The crucial env var to set is NEXT_PUBLIC_MEDUSA_BACKEND_URL. Make sure it points to an active Medusa server, including the protocol but without a trailing slash. E.g.: https://my-medusa-server.herokuapp.com

Double check if your Medusa server is running and healthy by visiting <YOUR-SERVER-URL>/health. This should return OK.

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

10 participants