Next.js Discord

Discord Forum

next dev --turbo error on API route request

Answered
Fire ant posted this in #help-forum
Open in Discord
Fire antOP
I'm using lib dependancy for response on my GET request

import { function } from 'otherLibrary';
import { NextRequest, NextResponse } from 'next/server';

export async function GET(request: NextRequest) {
  const id = // getting id
  try {
    // Getting data logic
    return NextResponse.json(result);
  } catch (error) {
   // return error 500
  }
}

And the response
Server Error

TypeError: File URL path must be absolute


Without
--turbo
it's working fine, i know it's on dev, not in production.
But why...
Answered by joulev
That means you just found a turbopack bug. Turbopack is not ready yet, so it might not work, as you see here. Time to opt out of turbopack
View full answer

2 Replies