Z
ZenStack

❓-help

Next.js 13 app directory support

UUUnknown User5/29/2023
Message Not Public
Sign In & Join Server To View
Yymc95/30/2023
Hi @serraglia , thanks for bringing this up. Next.js 13's app folder has a different route handler API than the api routes in previous versions. It's not natively supported by ZenStack's nextjs server adapter yet. Fortunately it's not too hard to create a shim for it. I've put a sample project here: https://github.com/zenstackhq/docs-tutorial-nextjs-app-dir The shim code is in "/src/app/api/model/[...path]/route.ts". It deals with the new route handler's API. The UI pages are still under "/src/pages" folder. I haven't got time to migrate them yet but it should be irrelevant to the problem. Moving forward we'll implement the "shim" in the ZenStack server adapter, and make it automatically adapted to the old and new Nextjs conventions. Hope the custom shim code works for you now, and let me know if you run into any issue. Btw, please make sure to update to the latest zenstack packages
UUUnknown User5/30/2023
3 Messages Not Public
Sign In & Join Server To View
Yymc96/2/2023
Hey @serraglia , thanks for the PR! I've left a comment there. Could you check when you get time to?
UUUnknown User6/3/2023
4 Messages Not Public
Sign In & Join Server To View

Looking for more? Join the community!

Want results from more Discord servers?
Add your server