Skip to content

[[email protected]] API route 500'ing in production, works locally #30349

@wadehammes

Description

@wadehammes

What version of Next.js are you using?

12.0.0

What version of Node.js are you using?

14.18.0

What browser are you using?

Firefox

What operating system are you using?

Windows

How are you deploying your application?

Vercel

Describe the Bug

I have a few api routes, and one of them is failing in production builds, but works fine locally. They work fine in previous stable version of next, 11.1.x.

image

Uncaught (in promise) Error: An error has occured: 500
    e useReviews.ts:32
    l runtime.js:63
    _invoke runtime.js:293
    S runtime.js:118
    Babel 6
    w useReviews.ts:21
    c useReviews.ts:59
    Ii React
    unstable_runWithPriority scheduler.production.min.js:18
    React 3
    D scheduler.production.min.js:16
    onmessage scheduler.production.min.js:12
    60053 scheduler.production.min.js:12
    Webpack 16

Expected Behavior

The API route should not 500 since it works locally.

To Reproduce

I am not exactly sure how to reproduce, but I am using an API route to fetch from a third-party API and return some json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions