Skip to content

Next.js setup docs omit the transpilePackages config used by the official example #15

@0xNeit

Description

@0xNeit

Summary

The official Next.js example app (apps/ssr-next) sets transpilePackages for the Motif packages, but the Next.js bundler guide (apps/docs/content/bundlers/next.mdx) never mentions it.

Details

  • apps/ssr-next/next.config.mjs:
    // motif-js workspaces ship 'use client' marked code; transpile is fine.
    transpilePackages: ['@usemotif/react', '@usemotif/tokens'],
  • Motif packages do ship 'use client'-marked modules — e.g. packages/react/src/Pressable.tsx, Link.tsx, _box-enter.tsx.
  • grep -n transpilePackages apps/docs/content/bundlers/next.mdx → no matches.

Impact

Developers following next.mdx may hit 'use client' / RSC build errors that the example app silently avoids by virtue of transpilePackages. (The ## Turbopack section of next.mdx is fine — that behavior is documented; this issue is only about transpilePackages.)

Suggested fix

  • Add a setup step to next.mdx showing the transpilePackages entry.
  • State explicitly whether it is required or merely recommended, and which packages must be listed for web vs native consumers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium severity

    Type

    No type
    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