#Nextjs app directory not works actions on Amplify...

45 messages · Page 1 of 1 (latest)

native gorge
#

Hi everyone i have a Nextjs app deployed on Amplify... i have also an action that works right in local but it seems not works on amplify? Someone can help me?

vocal oysterBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

queen ravine
#

hi, the action is not being call or failed to call?

native gorge
#

the first!

queen ravine
#

it works in local with next build && next start?

native gorge
#

i have tried only in dev

queen ravine
#

try build & start

native gorge
#

if you remember my action is a simple action that check if exist a cookie

queen ravine
#

yes try it with production build in local and see if it works first

#

inside a useEffect right?

native gorge
#

I will let you know

queen ravine
#

ok

native gorge
#

it works fine with build && start

queen ravine
#

ah

#

let me invite a expert of amplify here

#

@marsh basin here he is

native gorge
#

no problem sure

queen ravine
#

let see if @marsh basin knows this 😆

native gorge
#

Where I can see action log in Amplify ?

marsh basin
#

Haha thanks for the compliment. You are right, I am using amplify for all the backend stuff like auth, graphql, .. but actually not for hosting 🤫

native gorge
#

@queen ravine i have added more debug and the action is called but fails the method cookies()...

native gorge
# queen ravine any error?

So I don’t know why but when I use cookies method in production it returns a empty array… any suggestions?

queen ravine
native gorge
queen ravine
native gorge
#

So the domain is the same ….

native gorge
#

I will try… in dev and local works … I don’t know if a next problem, backend problem or amplify 😅

queen ravine
#

should be amplify

#

or try deploy it on vercel

native gorge
#

I have just tried on vercel the same situation

queen ravine
native gorge
#

Yes

queen ravine
#

oh

#

then you shouldn't be able to read it, because cookie only send with the same domain

#

but I wonder why it would work in local

native gorge
#

If I use different domain I should read it?

queen ravine
#

I don't think so

#

are you able to set it on your app?

native gorge
#

The problem was on backend side how it was settup the domain field.
Close the question