skip to Main Content

Firebase Callable Cloud Function CORS Error using Firebase Emulator and Vite

The following is the client-side code to call the cloud function: // add a new post addPostForm.addEventListener('click', (e) => { e.preventDefault(); const addPost = httpsCallable(functions, 'addPost'); addPost({ title: addPostForm.postTitle.value, description: addPostForm.postDescription.value, }) .then(() => { addPostForm.reset(), addPostModal.classList.remove('open'); addPostForm.querySelector('.error').textContent = '';…

VIEW QUESTION
Back To Top
Search