jonas
jonas
NNuxt
Created by jonas on 4/8/2024 in #❓・help
`netlify serve` not working with a nuxt app
I have a nuxt app deployed successfully to netlify. For local testing I wanted to run netlify serve which will build the production app and run it localhost. I get the error Cannot find module: .netlify/functions-serve/.unzipped/server/server.js and indeed, if I check this output folder there's no server.js file there. However there is a server.mjs file in the folder so I'm thinking that I have something misconfigured. I tried it on an empty nuxt project that I deployed to netlify and I can reproduce the error in that context as well. Anyone running nuxt on netlify knows what the problem is?
1 replies
NNuxt
Created by jonas on 3/12/2024 in #❓・help
difference between type `$Fetch` from ofetch and nitropack
What's the difference between
import { type $Fetch } from "nitropack";
import { type $Fetch } from "nitropack";
and
import { type $Fetch } from "ofetch"?
import { type $Fetch } from "ofetch"?
Currently if I try to use the one from "ofetch" I'm seeing
Argument of type '$Fetch<unknown, NitroFetchRequest>' is not assignable to parameter of type '$Fetch'.
Property 'native' is missing in type '$Fetch<unknown, NitroFetchRequest>' but required in type '$Fetch'.
Argument of type '$Fetch<unknown, NitroFetchRequest>' is not assignable to parameter of type '$Fetch'.
Property 'native' is missing in type '$Fetch<unknown, NitroFetchRequest>' but required in type '$Fetch'.
I'm currently using the one from "nitropack" in my nuxt project and it works fine, but I want to extract my ApiClient (which takes a $fetch argument in the constructor) to a separate package so I can use it in other contexts and I would like this package to only depend on "ofetch". Any ideas?
4 replies