cli icon indicating copy to clipboard operation
cli copied to clipboard

(dev) Deno crashes with PermissionDenied: Requires sys access to "cpus", run again with the --allow-sys flag

Open noelforte opened this issue 1 month ago • 1 comments

Describe the bug

When attempting to run a module that either depends directly or indirectly on a sys API call the Netlify Dev server crashes. The deno runtime recommends that --allow-sys be passed but this seems to be something outside of user-land.

Possibly related: https://github.com/denoland/deno/issues/22221

Steps to reproduce

  1. Use npm:fast-glob or any other module that depends either directly or indirectly on the node:os module in an edge-function.
  2. Attempt to launch dev server.

Configuration

n/a

Environment

System info output:

  System:
    OS: macOS 14.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 123.22 MB / 32.00 GB
    Shell: 3.7.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 22.1.0 - /opt/homebrew/bin/node
    npm: 10.8.0 - /opt/homebrew/bin/npm
    pnpm: 9.1.0 - /opt/homebrew/bin/pnpm
    bun: 1.1.8 - ~/.bun/bin/bun
  npmGlobalPackages:
    netlify-cli: 17.23.5

Additionally providing the output of netlify dev

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ No app server detected. Using simple static server
◈ Running static server from "netlify-dev-os/dist"
◈ Setting up local development server
Cleaned up .netlify/functions-internal.

◈ Static server listening to 3999

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

PermissionDenied: Requires sys access to "cpus", run again with the --allow-sys flag
    at Object.cpus (node:os:27:10)
    at Object.<anonymous> (file:///opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/.deno/[email protected]/node_modules/fast-glob/out/settings.js:10:31)
    at Object.<anonymous> (file:///opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/.deno/[email protected]/node_modules/fast-glob/out/settings.js:61:4)
    at Module._compile (node:module:659:34)
    at Object.Module._extensions..js (node:module:673:10)
    at Module.load (node:module:597:32)
    at Function.Module._load (node:module:484:12)
    at Module.require (node:module:609:19)
    at require (node:module:715:16)
    at Object.<anonymous> (file:///opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/.deno/[email protected]/node_modules/fast-glob/out/index.js:6:20) {
  name: "PermissionDenied"
}

noelforte avatar May 16 '24 00:05 noelforte