Skip to content

Get Store errors in NextJs API route #192

Open
@himynameistim

Description

@himynameistim

Describe the bug

I have a site using NextJs 13.4.10, and the build log shows Netlify automicatically installing @netlify/plugin-nextjs@4.41.3.

My site contains an API route which calls an external service. To cut down the number of API calls to this service I'm attempting to cache the results using Netlify Blobs. This will use a deploy specific store.

When I call the function to get the store the application errors. e.g.

const myStore = getDeployStore('myStore')

The following error is shown in the logs

Aug 19, 08:37:39 AM: 77dc63f7 ERROR  MissingBlobsEnvironmentError: The environment has not been configured to use Netlify Blobs. To use it manually, supply the following properties when creating a store: deployID
    at getDeployStore (/var/task/node_modules/@netlify/blobs/dist/main.cjs:624:11)
    at PrismicServices.getAlternativeTracks (/var/task/.next/server/chunks/5428.js:589:92)
    at search_events (/var/task/.next/server/pages/api/search-events.js:681:61)
    at /var/task/node_modules/next/dist/server/api-utils/node.js:463:16
    at /var/task/node_modules/next/dist/server/lib/trace/tracer.js:117:36
    at NoopContextManager.with (/var/task/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057)
    at ContextAPI.with (/var/task/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516)
    at NoopTracer.startActiveSpan (/var/task/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086)
    at ProxyTracer.startActiveSpan (/var/task/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847)
    at /var/task/node_modules/next/dist/server/lib/trace/tracer.js:106:107

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions