#Nextjs app directory not works actions on Amplify...
45 messages · Page 1 of 1 (latest)
🔎 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)
hi, the action is not being call or failed to call?
the first!
it works in local with next build && next start?
i have tried only in dev
try build & start
if you remember my action is a simple action that check if exist a cookie
yes try it with production build in local and see if it works first
inside a useEffect right?
ok
it works fine with build && start
no problem sure
let see if @marsh basin knows this 😆
you expected it not to work
Where I can see action log in Amplify ?
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 🤫
@queen ravine i have added more debug and the action is called but fails the method cookies()...
any error?
So I don’t know why but when I use cookies method in production it returns a empty array… any suggestions?
Im not sure, I've never use amplify.
You can confirm that I can read a cookie that a third party backend returns… a cookie secure and HttpOnly…. Read this cookie with an action
sorry I don't understand? so you are trying to read the cookies from a third party backend in the server action?
Yeah… I have a third party backend that set an auth cookie and I d like read it ….
So the domain is the same ….
App.myapp.com fe and api.myapp.com be
try headers().get("cookie") ?
I will try… in dev and local works … I don’t know if a next problem, backend problem or amplify 😅
I have just tried on vercel the same situation
the cookies are being set by the third party domain?
Yes
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
If I use different domain I should read it?
The problem was on backend side how it was settup the domain field.
Close the question