Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
noelforte opened this issue May 16, 2024 · 1 comment
Labels
type: bug code to address defects in shipped code

Comments

@noelforte
Copy link

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: denoland/deno#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 noelforte added the type: bug code to address defects in shipped code label May 16, 2024
@noelforte
Copy link
Author

noelforte commented May 16, 2024

Looks like this is an issue with the edge bundler @ https://github.com/netlify/build/, I'll check for or open a seperate issue over there and backreference to this one. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

1 participant