angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.67k stars 2.19k forks source link

updating node-fetch to v3 #3051

Open jimmywarting opened 2 years ago

jimmywarting commented 2 years ago

https://github.com/angular/angularfire/blob/a26676c69790b9a236dbc08504db705f983bd8fc/site/src/shortcodes/includecode/fetch.js#L17-L31 to use latest node-fetch version you would need to use import instead of require

 async function fetchCode(githubPath) { 
   const fetch = globalThis.fetch || import('node-fetch').then(mod => mod.default);
   const githubApiUrl = convertToGitHubApiUrl(githubPath); 
   const response = await fetch(githubApiUrl); 
   return response.text(); 
 } 
google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.