My netlify site name is “netlifynote2.netlify.app”.
I am using Netlify Blobs, but at “const notesStore = getStore(‘notepad-notes’);” it fails with an error “MissingBlobsEnvironmentError”.
This error is the error in the Functions log.
I have tried redeploying with cache clear.
I have also tried explicitly setting the site ID and access token.
The error and source code are listed below.
source code
import { getStore } from '@netlify/blobs';
export const handler = async (event) => {
try {
const notesStore = getStore('notepad-notes');
const notesData = await notesStore.get('user-notes', { type: 'json' });
return {
statusCode: 200,
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ notes: notesData || [] }),
};
} catch (error) {
console.error('Error loading notes from Blobs:', error);
return {
statusCode: 500,
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ error: 'Failed to load notes' }),
};
}
};
error
Jun 19, 04:43:08 PM: 675fbd8f ERROR Error loading notes from Blobs: MissingBlobsEnvironmentError: The environment has not been configured to use Netlify Blobs. To use it manually, supply the following properties when creating a store: siteID, token
Jun 19, 04:43:08 PM: 675fbd8f ERROR at getClientOptions (/var/task/netlify/functions/load-notes.js:312:11)
Jun 19, 04:43:08 PM: 675fbd8f ERROR at getStore (/var/task/netlify/functions/load-notes.js:585:27)
Jun 19, 04:43:08 PM: 675fbd8f ERROR at Runtime.handler (/var/task/netlify/functions/load-notes.js:624:24)
Jun 19, 04:43:08 PM: 675fbd8f ERROR at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1187:29)
Please help me.