nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

Ability to incorporate NextJS middleware #81

Closed cmonkey03 closed 2 years ago

cmonkey03 commented 2 years ago

I'd like to use the beta middleware feature: https://nextjs.org/docs/advanced-features/middleware. There seems to be some challenges working with babel in monorepos however: https://github.com/vercel/next.js/issues/35973

Building locally or in Vercel I get the following error. This happens even if the middleware function has nothing but the return statement.

Screen Shot 2022-06-08 at 3 31 12 AM

Any ideas on how to configure babel to handle this case?

kaceycleveland commented 2 years ago

Just noting that I am struggling with the same issues as well. My builds work without a custom .babelrc though. I am not using solito though in my case.

nandorojo commented 2 years ago

hmm weird, yeah i wouldn’t expect solito to be the cause of this, i assume it’s a next issue