Netlify-cli: ReferenceError: Response is not defined

Since about 6 hours ago I’ve started seeing the following error in my Github action netlify-cli deploy on my prod website:

05d4ff:9e2ffbde364a4ba294bc949da73e0dd4 deploy --dir=dist/site --functions=dist/functions --prod
 ›   ReferenceError: Response is not defined

I can’t see any changes to my code that could have cause it.

I’m running the usual netlify-cli command:

      - name: Deploy using Netlify CLI
        if: ${{ (env.deploy_enabled == 'yes' && env.refresh_cache == 'no') || env.refresh_cache_lucky == 'yes' }}
        uses: netlify/actions/cli@master
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
        with:
          args: deploy --dir=dist/site --functions=dist/functions --prod

In the previous step I have some debug logging:

echo "Site dir:"
ls -lah dist/site
echo "Functions dir:"
ls -lah dist/functions

And that correctly lists the files in dist/site and an empty directory in dist/fuctions (I’m not using functions, never have). So the files are in the deploy directory as far as I can see.

I’m stuck not able to deploy anyhting.

Is there something that might be happening with Netlify infra?

Update: I’m seeing this on all branches and all repos/sites I have checked

I just discovered that I am able to deploy directly to Netlify using cli, but the error is blocking any deploys happening inside Github Actions, so all deploys across all my sites are currently blocked.

Deploying directly bypassing Github actions isn’t a great workaround because there are a bunch of things that get done in the Github actions that I need to happen that don’t happen when I build and deploy locally, so I would appreciate some feedback on this.

22 hours since this started happening, and it’s still happening. Any ideas, hints, info on how I can troubleshoot to get it resolved? thks

I reset a fix branch to the main branch commit that was used to create the current live website. That’s a known good set of project files.

…and the deploy error persists.

Doesn’t that mean there must be something on the Netlify side that has changed, and that is blocking my deploys?

Hello, is anybody there?

I’ve run into the same issue. The github action is quietly failing with “ReferenceError: Response is not defined”. I didn’t even realize my last deploy of about 8 hours also failed.

Yeah thats exactly what happened to me. It fails silently which makes it even worse.

I checked the netlify-cli action’s repo and they havent made any code changes in a very long time, which really points to something in the Netlify infra that is causing the error.

Thanks for posting @srk i see you are new user. Welcome.

Thank you. I followed your input and used netlify cli for direct manual deploy. But that is definitely not ideal since it leaves some of my pre and post deploy steps to be done manually.

@netlifysupport team - can you help here. It has been more than two days since the issue was posted.

same here as well… waiting for the fix…

Ideally, you don’t need the CLI action. You can simply install CLI as a part of your workflow. In any case, I’ve updated the action to v2.0.0: update to Node.js 22 · netlify/actions@3185065, which should resolve this.

Thanks @hrishikesh - that fixed the issue, my deploys are working again from within Github Actions.

Ideally, you don’t need the CLI action

Are you saying that instead of using the published netlify github action, we should just have a step like:

- name: Deploy to Netlify
  run: |
    npm install netlify-cli -g
    netlify deploy --dir=./dist/site --functions=./dist/functions

Is there no advantage to using the action?

I have the same error on my sites…

Run netlify/actions/cli@master
  with:
    args: deploy --dir=public --prod
  env:
    NETLIFY_SITE_ID: ***
    NETLIFY_AUTH_TOKEN: ***

Does this mean the GitHub Action is not recommended any more?

Yeah you’re right. You can just install the CLI yourself and you’re good to go. I don’t see any obvious advantages of using the Action.

1 Like

@hrishikesh - thanks for the clarification.

@hrishikesh Does this mean I have to replace my (previously working) Netlify GitHub Action with the Netlify-CLI tool for all of my sites?

I have many sites hosted on Netlify. Why does the GH action is not getting fixed?