Problem with Intro to serverless functions tutorial

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name: pnp-netlify-serverless

Trying to follow your Intro to Serverless Functions | Netlify tutorial. When I attempt to introduce a netlify functions folder and ntl dev I get the following output.

unknown: Could not find entry: /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket ⠇ Waiting for framework port 1234. This can be configured using the 'targetPort' property in the netlify.toml

I noticed a few issues as I attempted to follow the tutorial.

1: The ntl cli constantly gives permissions errors. You can run sudo, but if you attempt to modify the netlify.toml you cannot save it, sudo or no sudo. I had to manually (on mac) go to permissions, add my user, and configure read-write access. I couldn’t even specify the “everyone” read write permissions.

This ability is necessary, because you have to manually add the:

[functions]
  node_bundler = "esbuild"

referenced in the tutorial.

Secondly, the cli on init tries to set up parcel as the default bundler. If you attempt to input the # no build command, it still will try to use parcel.

2:

Here’s the full console output:

(base)  ✘ ✝  prototypes/pnp-netlify-serverless/netlify-serverless-pocket   main±  ntl dev
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Loaded function hello-world http://localhost:8888/.netlify/functions/hello-world.
◈ Functions server is listening on 49876
◈ Setting up local development server

────────────────────────────────────────────────────────────────
  Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 29.1.1

❯ Flags
  {}

❯ Current directory
  /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket

❯ Config file
  /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket/netlify.toml                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

Error: ◈ Could not create directory: /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket/.netlify/functions-serve
    at error (file:///usr/local/lib/node_modules/netlify-cli/src/utils/command-helpers.mjs:181:52)
    at getTargetDirectory (file:///usr/local/lib/node_modules/netlify-cli/src/lib/functions/runtimes/js/builders/zisi.mjs:102:5)
    at handler (file:///usr/local/lib/node_modules/netlify-cli/src/lib/functions/runtimes/js/builders/zisi.mjs:136:27)
    at Module.getBuildFunction (file:///usr/local/lib/node_modules/netlify-cli/src/lib/functions/runtimes/js/index.mjs:40:23)
    at NetlifyFunction.build (file:///usr/local/lib/node_modules/netlify-cli/src/lib/functions/netlify-function.mjs:78:27)
    at FunctionsRegistry.buildFunctionAndWatchFiles (file:///usr/local/lib/node_modules/netlify-cli/src/lib/functions/registry.mjs:73:53)

Node.js v18.12.1
(base)  ✘ ✝  prototypes/pnp-netlify-serverless/netlify-serverless-pocket   main±  sudo ntl dev
Password:
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Loaded function hello-world http://localhost:8888/.netlify/functions/hello-world.
◈ Functions server is listening on 50268
◈ Setting up local development server

────────────────────────────────────────────────────────────────
  Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 29.1.1

❯ Flags
  {}

❯ Current directory
  /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket

❯ Config file
  /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket/netlify.toml

❯ Context
  dev

────────────────────────────────────────────────────────────────
  1. Run command for local development                          
────────────────────────────────────────────────────────────────

◈ Starting Netlify Dev with Parcel
Server running at http://localhost:1234
🚨 Build failed.

unknown: Could not find entry: /Users/mheavers/Documents/Mozilla/Graceland/prototypes/pnp-netlify-serverless/netlify-serverless-pocket
⠴ Waiting for framework port 1234. This can be configured using the 'targetPort' property in the netlify.toml

Hey @heaversm,

Could you make sure that Full Disk Access in System Settings in enabled for Terminal: