Skip to content

Next.js examples fail on StackBlitz due to Turbopack usage in interactive sandbox #11063

Description

@Rpaudel379

Describe the bug

The interactive sandbox on example pages using Next.js runs:
npm install && npx next dev
instead of using the project's npm run dev script.

Additionally, the dev script in these examples currently runs next dev without the --webpack flag. Since Next.js 16 enables Turbopack by default, these examples fail on StackBlitz because Turbopack native bindings are not available in the WebContainer environment.

This affects Next.js examples where the docs sandbox starts the app with the default Turbopack configuration.

Current affected example pages:

Fix

  • Update the dev script in affected Next.js examples to use Webpack:
"dev": "next dev --webpack"
  • Update the interactive sandbox run command to:
npm install && npm run dev

// or

npm install && npx next dev --webpack

Your minimal, reproducible example

https://stackblitz.com/github/tanstack/query/tree/main/examples/react/optimistic-updates-ui?embed=1&theme=dark&preset=node&file=src/index.tsx

Steps to reproduce

  1. Go to

Expected behavior

It should start example docs sandbox without any runtime errors.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Linux - Chrome

Tanstack Query adapter

No response

TanStack Query version

^5.101.2

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions