i just created a new nuxt 3 beta project. It’s quite empty at the moment. It only contains the app.vue which displays a 'hello world!"
Running local dev server and show site works!
Deploying site on Netlify works! “Hello World” is shown.
BUT!!! I will use netlify functions within my project and therefore to be able to develop and test locally i need to use netlify-cli’s “netlify dev” command.
So i installed netlify-cli and run the command.
and when accessing http://localhost:8888 i get a “Not Found” page as it cannot find my site displaying “hello World”. So my question is how do i need to configure netlify dev to get it to work?
This is my netlify.toml file:
[build]
command = "npm run build"
functions = "netlify/functions"
publish = "dist"
[dev]
command = "npm run dev"
autoLaunch = true
[functions]
node_bundler = "esbuild"
directory = "netlify/functions"
[[headers]]
# Define which paths this specific [[headers]] block will cover.
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "*"
some environment variables which values i don’t want to show here.
Edit:
The above testing was done with Netlify CLI v6.9.15. After upgrading to v6.13.2 the above [dev] section is not required in the netlify.toml as it automatically detects Nuxt 3.
thank you very much for your reply! You perfectly helped me. With your [dev] part in netlify.toml i also get it to work.
But as i recognized with your post that my netlify version ist also older (netlify-cli/6.9.17) i thought, ok, i should better update.
But here i get problems. When i try npm install -g netlify-cli@latest i still endup with my 6.9.17 version. and when i run npm uninstall -g netlify-cli it remains there. It does not seem to uninstall it. Whatever i try i am stuck to 6.9.17.
Do you maybe have an idea what my problem could be?