Skip to content
Discussion options

You must be logged in to vote

Finally, I found the issue: according to the NEXTJS 13 documentation, "Route Handlers are statically evaluated by default when using the GET method with the Response object," and later on, "Route handlers are evaluated dynamically when: Using the Request object with the GET method," among others. Therefore, keeping in mind this last premise of NEXTJS 13, I solved the problem with a simple change to the API using the Request object. Attached is the change in the API at backend.

`
const mongoose = require('mongoose');
import { NextResponse } from 'next/server'

import { EstadoAdministrativo } from '@/models/estados';
//import { NextResponse } from 'next/server'

export async function GET(requ…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ricardoc05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant