next dev --turbo error on API route request
Answered
Fire ant posted this in #help-forum
Fire antOP
I'm using lib dependancy for response on my GET request
And the response
Without
But why...
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 absoluteWithout
--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
2 Replies
@Fire ant I'm using lib dependancy for response on my GET request
js
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
bash
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...
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
Answer
@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
Fire antOP
Thanks for mentioning it was a bug from turbopack