Closed ziggy6792 closed 7 months ago
IMO, T3 is a trap... anyways, it's b/c you're using trpc:
unstable_httpBatchStreamLink
This requires streaming to be enabled, (see NextjsSite docs)
Wow thanks for such a quick reply. I take your point about T3
So it seem you are saying I have 2 options?
Remove the unstable_httpBatchStreamLink
This had no effect
Enable steaming https://docs.sst.dev/constructs/NextjsSite as shown here I got a different issue
Added a commit
Thanks again so much for your help :)
You have to check the cloudwatch logs for the error message.
Hey, do you mean the cloudwatch logs for the lambda server function? There are none
Thanks :)
There should be logs somewhere in the log groups. Trying using: https://docs.sst.dev/constructs/NextjsSite#logging
Thanks, I tried that. But I think that only combines the logs for different routes. I don't see any logs so its not useful.
Also, trpc is not the issue as when I totally remove it I get the same issue (returning null) Commit here
If anyone has an example of open next with the new apps directory that would also be great as maybe I could work forward from there.
Edit: Found this, will try https://github.com/sst/open-next/tree/main/examples/app-router
Hey @khuezy
After a long slog I fixed it. Using this for reference helped a lot
In the end all I had to do was upgrade to the latest open-next (now using it as a dev dependency) and a few other packages. Commit here
FYI I did also get it working with
experimental: {
streaming: true,
}
But for this you also need to use streaming
arg like this
"openbuild": "open-next build --streaming",
Thanks
You shouldn't need to set buildCommand
unless you have a specific need for it. Most of the props (except minify) are exposed via NextjsSite
.
The reason why it's used in the examples is b/c it has to reference open-next
itself.
Hi firstly thanks so much for this!
I had a lot of success deploying this using next 13 and the old pages directory but not the new apps directory.
When I use the new apps directory my deployed site just returns null https://dvy374fpkcsdt.cloudfront.net/ Example branch here https://github.com/ziggy6792/typescript-journey/tree/apps-directory It is very hard to debug. I see no issues in the server lambda or in the browser console.
But using the old next JS pages directory everything works fine Example branch here https://github.com/ziggy6792/typescript-journey/tree/pages-directory
FYI both sample next apps above were simply created from t3 https://create.t3.gg/ just with
EXPERIMENTAL Would you like to use Next.js App Router?
on or offI thought maybe apps directory is not supported yet. But it says here that it is https://open-next.js.org/
Any help would be very very much appreciated.
Thanks,