Support Forums

Is there a way to access netlify functions during build

I have a project where a build a jamstack nuxt application. The content of the page comes from netlify lamda functions. Is there a way that i can access the functions while building the frontend.

Espacally when something changes inside the functions and frontend that would be useful. In this case your not able to access the already depoloyed functions.

You can access the functions, but you’ll always access the functions from the previous deploy than the one you’re currently trying. If that’s fine by you, then you should be able to write a build script that can connect to your functions.

I’m not sure how you’re planning to do this. How can something change inside the functions? Would you please expand a little more on this?

So for example my function gives be back an json object with a key abc. Which i print out in the frontend using this key.
If i know want to change this key to asdf. I would change the function to give me back the object with the new name. But also would use this new key while building the static sites with nuxt.

I have also same issue any suggestion for this so please reply.

So yeah, the function that you access during build will be the one from previous deploy as the current deploy is still in progress.

So, you’d have to update the function first → deploy successfully and rebuild again.