cli icon indicating copy to clipboard operation
cli copied to clipboard

Empty args assigned, this is an internal Netlify Dev bug, please report your settings and scripts so we can improve

Open Nisfan opened this issue 6 years ago • 6 comments

Describe the bug

Netlify dev doesn't work with latest version netlify-cli/2.64.1 win32-x64 node-v12.13.1

Configuration

netlify.toml:

[dev]
  functions = "src/lambda_functions"
  port = 4000 #port netlify dev runs on
  command = 'yarn develop'

package.json:

{
  "name": "rmsv",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "develop": "netlify dev",
    "build": "gatsby build",
    "clean": "gatsby clean",
    "format": "prettier --write src/**/*.{js,jsx}",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\""
  },
  "dependencies": {
    "@simplur/micro-site": "1.0.4",
    "gatsby": "^2.24.63",
    "netlify-lambda": "^2.0.1",
    "react": "^16.13.1",
    "react-dom": "^16.13.1"
  }
}
System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 4.89 GB / 15.89 GB
  Binaries:
    Node: 12.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.12.1 - C:\Program Files\nodejs\npm.CMD

Expected behavior

Netlify Dev should run locally.

CLI Output

image

Nisfan avatar Sep 28 '20 14:09 Nisfan

Same for netlify-cli/2.64.1 darwin-x64 node-v12.18.4

heldr avatar Sep 28 '20 16:09 heldr

I have fixed the issue by adding "start": "gatsby develop", into package.json and set netlify command to yarn start

Nisfan avatar Sep 29 '20 15:09 Nisfan

Yeap, the issue is that command args are empty here https://github.com/netlify/cli/blob/master/src/utils/detect-server.js#L211

wrapping command in a npm task is a workaround and also worked for me. Thanks!

heldr avatar Sep 29 '20 15:09 heldr

Any update on a fix for this?

zwallacedev avatar Oct 06 '20 01:10 zwallacedev

@zwallacedev as the original issue was closed, do you mind opening a new one with your configuration?

erezrokah avatar Oct 06 '20 08:10 erezrokah

This was also happening to me when the command was wrapped in a package.json script:

"dev": "CONTEXT=development MOLLIE_API_KEY=test_xyz netlify dev"

netlify dev here corresponds to (via netlify.toml): gatsby develop.

Funny thing is, after I did @Nisfan 's suggestion of running gatsby develop via a wrapped package.json script, It also started working via my original yarn dev command.

dieterwalckiers avatar Dec 06 '20 17:12 dieterwalckiers