diff --git a/snippets/storage-next/download-files/storage_download_via_url.js b/snippets/storage-next/download-files/storage_download_via_url.js index c90e235c..69e69554 100644 --- a/snippets/storage-next/download-files/storage_download_via_url.js +++ b/snippets/storage-next/download-files/storage_download_via_url.js @@ -8,7 +8,9 @@ import { getStorage, ref, getDownloadURL } from "firebase/storage"; const storage = getStorage(); -getDownloadURL(ref(storage, 'images/stars.jpg')) +const starsRef = ref(storage, 'images/stars.jpg'); + +getDownloadURL(starsRef) .then((url) => { // `url` is the download URL for 'images/stars.jpg' diff --git a/storage-next/download-files.js b/storage-next/download-files.js index 6e94e63a..5e866e7b 100644 --- a/storage-next/download-files.js +++ b/storage-next/download-files.js @@ -23,7 +23,9 @@ function downloadViaUrl() { const { getStorage, ref, getDownloadURL } = require("firebase/storage"); const storage = getStorage(); - getDownloadURL(ref(storage, 'images/stars.jpg')) + const starsRef = ref(storage, 'images/stars.jpg'); + + getDownloadURL(starsRef) .then((url) => { // `url` is the download URL for 'images/stars.jpg'