nuxt-community / netlify-files-module

Nuxt 2 module to create new _headers, _redirects and netlify.toml files for Netlify or to use existing ones
MIT License
50 stars 5 forks source link

Long running netlifyFiles causes nuxt generate to timeout #25

Open pelargir opened 3 years ago

pelargir commented 3 years ago

If the netlifyFiles function is using async/await to add dynamic config from an API and takes longer than 5 secs to do this, the nuxt generate process will timeout with the following error:

 ⚠ Nuxt Warning                                                                  

 The command 'nuxt generate' finished but did not exit after 5s                  
 This is most likely not caused by a bug in Nuxt                                 
 Make sure to cleanup all timers and listeners you or your plugins/modules start.
 Nuxt will now force exit                                                        

 DeprecationWarning: Starting with Nuxt version 3 this will be a fatal error     

I believe the solution involves passing in a callback from Nuxt so Nuxt knows something is still happening during async/await construction of the config. I'm not sure how to implement that, though.