Hi,
Newbie of Netlify functions here!
I am setting up a new project using CRUD functions, following these two tutorials
Create your first Netlify functions
Building Serverless CRUD apps with Netlify Functions & FaunaDB
However, when I use the command netlify dev
, my simple helloWorld function is not accessible. I think there might be something wrong with my configuration, since the app is looking for the function in port 3000, while according to the docs the function should run in port 8888
Could someone take a look at my project setup please? Specifically the netlify.toml file. This is my repo for the project, which follows the youtube tutorial.
Thank you!
If you go to localhost:8888
in your browser, your Functions will automatically connect to localhost:8888/.netlify/functions
.
Hi @hrishikesh , when I run ntl dev, I have this error in the console
wasm streaming compile failed: TypeError: Failed to parse URL from /opt/homebrew/lib/node_modules/netlify-cli/node_modules/netlify-redirector/lib/redirects.wasm
Is there something I should be changing in the configuration? My version of node is v18.4.0 and netlify is netlify-cli/10.7.1
Not sure if this is related, but CLI doesn’t work well on Node 18:
opened 01:07PM - 10 Nov 21 UTC
closed 09:20AM - 19 Jul 22 UTC
medium priority
type: bug
area: command: dev
**Describe the bug**
Similar to this: https://github.com/netlify/cli/issues/2… 882#issue-939909811
Netlify Dev tries to start a server, it injects the environment variables, parses the configuration files and starts the local server of the framework, however it never starts the Netlify CLI's server.
Till now, the behaviour has been observed with Vite and Create React App (but more frameworks could be affected). This has been observed on MacOS 12. Other Operating Systems have not been checked.
This works with Node `14.17.5`, possibly with any other Node version than Node 17.
**To Reproduce:**
1. Use Node 17 (17.0.1 at the time of writing).
1. Try running `netlify dev` in a project (possibly in a Vite or CRA project)
1. See that the dev server never starts.
**Configuration**
```bash
System:
OS: macOS 12.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 891.31 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
npm: 8.1.1 - ~/.nvm/versions/node/v17.0.1/bin/npm
```
**Expected behaviour**
The Netlify Dev server should start.
**CLI Output**
Vite:
```
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Starting Netlify Dev with vite
> dev
> vite
vite v2.4.1 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 217ms.
```
**Additional context**
Marked `low-priority` as there's a workaround to use a different Node version.
Does the issue occur on Node 16 too?
That was it indeed! I downgraded to node 16.0.0 and it worked!