- 
                Notifications
    You must be signed in to change notification settings 
- Fork 40
Description
Versions
- What is this plugin's version?
 2.2.0
- What is Cypress version?
 13.1.0
- What Netlify build image are you using? This setting is available under "Deploy settings / Build image selection". Probably either "Ubuntu Trusty 14.04" or "Ubuntu Xenial 16.04"
 Ubuntu Focal 20.04 (default)
- What is the Node version if you know it?
 v16.20.2
- What is the NPM version if you know it?
 v8.19.4
Describe the bug
I get a "ECONNREFUSED ::1:3000" error when I try to specify a local server in my netlify.toml file (i.e. yarn start):
  [plugins.inputs.preBuild]
  enable = true
  spec = "src/components/**/*.spec.cy.js"
  start = 'yarn start'
  wait-on = 'http://localhost:3000'
  wait-on-timeout = '30' # seconds
(the entire toml file is below if you need it)
Oddly I can see from the logs that the local server is running - the problem is connecting to it.
I also have a postBuild section but no "start" option because the default suffices (adding start, wait-on, and wait-on-timeout to postBuild while removing preBuild gives me the same connection error).
Entire netlify.toml:
[build]
command = "yarn install && yarn build"
publish = "build"
[build.environment]
# cache Cypress binary in local "node_modules" folder
# so Netlify caches it
CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary"
[[plugins]]
  package = "netlify-plugin-cypress"
  [plugins.inputs]
  configFile = "./cypress.config.js"
  [plugins.inputs.preBuild]
  enable = true
  spec = "src/components/**/*.spec.cy.js"
  start = 'yarn start'
  wait-on = 'http://localhost:3000'
  wait-on-timeout = '30' # seconds
  [plugins.inputs.postBuild]
  enable = true
(changing the timeout to 90 seconds didn't fix the problem)
Logs and screenshots
Here is the netlify error log:
2:22:53 PM: netlify-plugin-cypress (onPreBuild event)
2:22:53 PM: ────────────────────────────────────────────────────────────────
2:22:53 PM: 
2:22:53 PM: [STARTED] Task without title.
2:22:55 PM: [SUCCESS] Task without title.
2:22:56 PM: DevTools listening on ws://127.0.0.1:45077/devtools/browser/1d8c8f99-86a4-48be-af6c-4ecaacfa65c1
2:22:56 PM: [4197:0907/212256.405938:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
2:22:56 PM: Displaying Cypress info...
2:22:56 PM: Detected no known browsers installed
2:22:56 PM: Proxy Settings: none detected
2:22:56 PM: Environment Variables:
2:22:56 PM: CYPRESS_CACHE_FOLDER: ****
2:22:56 PM: Application Data: /opt/buildhome/.config/cypress/cy/development
2:22:56 PM: Browser Profiles: /opt/buildhome/.config/cypress/cy/development/browsers
2:22:56 PM: Binary Caches: /opt/build/repo/node_modules/CypressBinary
2:22:56 PM: Cypress Version: 13.1.0 (stable)
2:22:56 PM: System Platform: linux (Ubuntu - 20.04)
2:22:56 PM: System Memory: 66.3 GB free 57.8 GB
2:22:56 PM: waiting on http://localhost:3000/ with timeout of 30 seconds
2:22:56 PM: yarn run v1.22.19
2:22:56 PM: $ react-scripts start
2:22:58 PM: Browserslist: caniuse-lite is outdated. Please run:
2:22:58 PM:   npx update-browserslist-db@latest
2:22:58 PM:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
2:22:58 PM: (node:4271) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
2:22:58 PM: (Use node --trace-deprecation ... to show where the warning was created)
2:22:58 PM: (node:4271) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
2:22:58 PM: Starting the development server...
2:22:58 PM:
2:23:09 PM: Compiled successfully!
2:23:09 PM: You can now view vianai in the browser.
2:23:09 PM:   Local:            http://localhost:3000
2:23:09 PM:   On Your Network:  http://10.71.106.148:3000
2:23:09 PM: Note that the development build is not optimized.
2:23:09 PM: To create a production build, use yarn build.
2:23:09 PM: webpack compiled successfully
2:23:26 PM: http://localhost:3000/ timed out on retry 31 of 1
2:23:26 PM: 
2:23:26 PM: Plugin netlify-plugin-cypress failed
2:23:26 PM: ────────────────────────────────────────────────────────────────
2:23:26 PM: 
2:23:26 PM:   Error message
2:23:26 PM:   GotError: connect ECONNREFUSED ::1:3000
2:23:26 PM: 
2:23:26 PM:   Plugin details
2:23:26 PM:   Package:        netlify-plugin-cypress
2:23:26 PM:   Version:        2.2.0
2:23:26 PM:   Repository:     git+https://github.com/cypress-io/netlify-plugin-cypress.git
2:23:26 PM:   npm link:       https://www.npmjs.com/package/netlify-plugin-cypress
2:23:26 PM:   Report issues:  https://github.com/cypress-io/netlify-plugin-cypress/issues
2:23:26 PM: 
2:23:26 PM:   Error location
2:23:26 PM:   In onPreBuild event in netlify-plugin-cypress from netlify.toml
2:23:26 PM: 
2:23:26 PM:   Resolved config
2:23:26 PM:   build:
2:23:26 PM:     command: yarn install && yarn build
2:23:26 PM:     commandOrigin: config
2:23:26 PM:     environment:
2:23:26 PM:       - CYPRESS_CACHE_FOLDER
2:23:26 PM:       - GENERATE_SOURCEMAP
2:23:26 PM:       - REACT_APP_ELASTIC_URL
2:23:26 PM:       - REACT_APP_G_ANALYTICS_ID
2:23:26 PM:       - REACT_APP_G_CLIENT_URI
2:23:26 PM:       - REACT_APP_HOTJAR_ID
2:23:26 PM:       - REVIEW_ID
2:23:26 PM:       - TERM
2:23:26 PM:     publish: /opt/build/repo/build
2:23:26 PM:     publishOrigin: config
2:23:26 PM:   plugins:
2:23:26 PM:     - inputs: {}
2:23:26 PM:       origin: config
2:23:26 PM:       package: netlify-plugin-cypress
2:23:30 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:23:30 PM: Failing build: Failed to build site
2:23:30 PM: Finished processing build request in 1m18.548s