Nuxt3: `useRequestEvent()` return undefined in server plugin

I want to access header.node.req._parsedUrl but it’s return undefined. Anyone know what’s the solution.

Here’s the code


// plugins/init.server.ts

export default defineNuxtPlugin((nuxtApp) => {
  const header = useRequestEvent();
  console.log(header.node.req._parsedUrl);
});