New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Has anyone managed to get mirage to work with Next.js 13.4? #1088
Comments
I have exactly the same issue and I'm trying to figure out about how to solve it. I'm not able to use Next Link or App Router because it looks that "Mirage" intercepts it. However, I discover that, if I comment |
Are you telling the Next server to run it on the client side? Without it, |
Here is the only solution (workaround) that worked for me:
|
@maorazoulay If I might suggest a possible simpler solution? You could be to rely on 'use client'
import { createServer } from "mirage";
createServer();
export default function MirageServer(): null { return null } This worked for me. |
Regardless of the solution used to setup mirage on the client side, this won't fix navigation unfortunately...
🥲 |
The error |
- API: rename and modify /user routes (formerly /login) - api-server: add GET /user route to provide FE with data for logged-in user - Allow user to create user and login from website - Remove Mirage, too much trouble now that api server exists, doesn't play well with nextjs App Router without workarounds: miragejs/miragejs#1088
- API: rename and modify /user routes (formerly /login) - api-server: add GET /user route to provide FE with data for logged-in user - Allow user to create user and login from website - Remove Mirage, too much trouble now that api server exists, doesn't play well with nextjs App Router without workarounds: miragejs/miragejs#1088
Used this approach for a while but noticed it refreshes the entire application on every route change. E.g. a context will lose all data by navigating to other page. |
To fix the error |
Hi, I had it working fine using the page based routing but upgraded to 13.4 and to the app based routing using a route.js file in the /app /api folder and it doesn't seem to recognized the mirage server. Just getting 404 errors now in my fetch. Thanks
My work around is just returning hard-coded JSON from the NextJs route.ts/js file using the NextResponse.json method.
The text was updated successfully, but these errors were encountered: