alexeliot
alexeliot
NNuxt
Created by alexeliot on 12/30/2024 in #❓・help
Cannot find module './lib/source-map-generator'
I spotted what caused this error by adding a debugger breakpoint on a nitro hook:
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('error', (error) => {
console.log(error) // Add breakpoint here. You should be able to see the module causing the problem while inspecting error.cause, in case it does not print on the error page
}
})
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('error', (error) => {
console.log(error) // Add breakpoint here. You should be able to see the module causing the problem while inspecting error.cause, in case it does not print on the error page
}
})
Make sure to run nuxt dev --inspect for the debugger to attach.
7 replies
NNuxt
Created by alexeliot on 12/30/2024 in #❓・help
Cannot find module './lib/source-map-generator'
I've resolved the issue. If anyone stumbles on this as well, it was because I was using @headlessui/vue in an outdated way. I had @headlessui/vue listed under modules in my nuxt.config.ts. Apparently there's a nuxt module for it now. I replaced it with that, updated my tsconfig according to the new docs and the problem was fixed.
7 replies