Neltify Background function is not working and not showing logs in Production

Neltify Background function is not working and not showing logs in Production.

It should be automictic in Prod(calling the api in dev is working fine).

deploy-succeeded-background.ts
deploy-failed-background.ts
deploy-succeeded-background.ts

I am able to see the function listed but:

I tried a lot in dev it’s triggered because I need to call the api.

In Prod it should be automatic.

I already did a lot of re-search and went through by Netlify doc but no luck.

@fool @gualter @hrishikesh

Hi there, glad you found us before we can help you, we need a little more information on the issues you are facing.

First, have you looked through this resource? It is a compilation of all of our build and deploy resources. This is a good starting point.

If you have worked through those guides and are still encountering issues please share the following information:

  • the name of your build instance: “example-jones.netlify.com
  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console

@SamO
I already did a lot of re-search on same using Netlify doc.

In dev it is working.

In Production It is not working.
I am able to see function but in Log slash / is keep rotating.

Please relate my question to netlify doc.

import { BackgroundHandler, HandlerEvent, HandlerContext } from '@netlify/functions';



console.log('In Deploy Building - file'); // not able to call

export const handler: BackgroundHandler = async (event: HandlerEvent, context: HandlerContext) => {
  console.log('Deploy Building - handler'); // not able to call this log as well
  if(process.env.NODE_ENV === 'prod'){ 

    console.log('Deploy Building - production');
    // not able to call this function
    sendNotif();

  }

};