nextjs - 💡(How to fix) Fix Turbopack breaks when parsing react-native code [7 comments, 5 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86784Fetched 2026-04-08 02:09:15
View on GitHub
Comments
7
Participants
5
Timeline
11
Reactions
0
Author
Timeline (top)
commented ×7subscribed ×2issue_type_added ×1labeled ×1

Error Message

Parsing ecmascript source code failed

Code Example

## Error Type
Build Error

## Error Message
Parsing ecmascript source code failed

## Build Output
./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js:13:13
Parsing ecmascript source code failed
  11 | // TODO: move this file to shims/ReactNative (requires React update and sync)
  12 |
> 13 | import type {HostComponent} from '../../src/private/types/HostComponent';
     |             ^
  14 |
  15 | import requireNativeComponent from '../../Libraries/ReactNative/requireNativeComponent';
  16 | import UIManager from '../ReactNative/UIManager';

Expected ',', got '{'

Import traces:
  Client Component Browser:
    ./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js [Client Component Browser]
    ./node_modules/react-native-safe-area-context/lib/module/specs/NativeSafeAreaView.js [Client Component Browser]
    ./node_modules/react-native-safe-area-context/lib/module/SafeAreaView.js [Client Component Browser]
    ./node_modules/react-native-safe-area-context/lib/module/index.js [Client Component Browser]
    ./node_modules/react-native-css-interop/dist/runtime/components.js [Client Component Browser]
    ./node_modules/react-native-css-interop/dist/runtime/wrap-jsx.js [Client Component Browser]
    ./node_modules/react-native-css-interop/dist/runtime/jsx-dev-runtime.js [Client Component Browser]
    ./node_modules/nativewind/jsx-dev-runtime/index.js [Client Component Browser]
    ./apps/web/src/app/registry.tsx [Client Component Browser]
    ./apps/web/src/app/registry.tsx [Server Component]
    ./apps/web/src/app/layout.tsx [Server Component]

  Client Component SSR:
    ./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js [Client Component SSR]
    ./node_modules/react-native-safe-area-context/lib/module/specs/NativeSafeAreaView.js [Client Component SSR]
    ./node_modules/react-native-safe-area-context/lib/module/SafeAreaView.js [Client Component SSR]
    ./node_modules/react-native-safe-area-context/lib/module/index.js [Client Component SSR]
    ./node_modules/react-native-css-interop/dist/runtime/components.js [Client Component SSR]
    ./node_modules/react-native-css-interop/dist/runtime/wrap-jsx.js [Client Component SSR]
    ./node_modules/react-native-css-interop/dist/runtime/jsx-dev-runtime.js [Client Component SSR]
    ./node_modules/nativewind/jsx-dev-runtime/index.js [Client Component SSR]
    ./apps/web/src/app/registry.tsx [Client Component SSR]
    ./apps/web/src/app/registry.tsx [Server Component]
    ./apps/web/src/app/layout.tsx [Server Component]

Next.js version: 15.5.0 (Turbopack)

---

Operating System:
  Platform: linux
  Arch: x64
  Version: #202510191616~1761932270~24.04~b3a306c SMP PREEMPT_DYNAMIC Fri O
  Available memory (MB): 15659
  Available CPU cores: 20
Binaries:
  Node: 22.20.0
  npm: 10.9.3
  Yarn: N/A
  pnpm: 10.15.0
Relevant Packages:
  next: 16.1.0-canary.12 // Latest available version is detected (16.1.0-canary.12).
  eslint-config-next: 15.5.0
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/xLucaH/react-native-starter

To Reproduce

  1. Clone the application above
  2. Run pnpm dev and open localhost:3000, see that it's working
  3. Change /apps/web/package.json to have "dev": "next dev --turbo"
  4. Run pnpm dev again and see the error

Current vs. Expected behavior

We get an error:

## Error Type
Build Error

## Error Message
Parsing ecmascript source code failed

## Build Output
./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js:13:13
Parsing ecmascript source code failed
  11 | // TODO: move this file to shims/ReactNative (requires React update and sync)
  12 |
> 13 | import type {HostComponent} from '../../src/private/types/HostComponent';
     |             ^
  14 |
  15 | import requireNativeComponent from '../../Libraries/ReactNative/requireNativeComponent';
  16 | import UIManager from '../ReactNative/UIManager';

Expected ',', got '{'

Import traces:
  Client Component Browser:
    ./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js [Client Component Browser]
    ./node_modules/react-native-safe-area-context/lib/module/specs/NativeSafeAreaView.js [Client Component Browser]
    ./node_modules/react-native-safe-area-context/lib/module/SafeAreaView.js [Client Component Browser]
    ./node_modules/react-native-safe-area-context/lib/module/index.js [Client Component Browser]
    ./node_modules/react-native-css-interop/dist/runtime/components.js [Client Component Browser]
    ./node_modules/react-native-css-interop/dist/runtime/wrap-jsx.js [Client Component Browser]
    ./node_modules/react-native-css-interop/dist/runtime/jsx-dev-runtime.js [Client Component Browser]
    ./node_modules/nativewind/jsx-dev-runtime/index.js [Client Component Browser]
    ./apps/web/src/app/registry.tsx [Client Component Browser]
    ./apps/web/src/app/registry.tsx [Server Component]
    ./apps/web/src/app/layout.tsx [Server Component]

  Client Component SSR:
    ./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js [Client Component SSR]
    ./node_modules/react-native-safe-area-context/lib/module/specs/NativeSafeAreaView.js [Client Component SSR]
    ./node_modules/react-native-safe-area-context/lib/module/SafeAreaView.js [Client Component SSR]
    ./node_modules/react-native-safe-area-context/lib/module/index.js [Client Component SSR]
    ./node_modules/react-native-css-interop/dist/runtime/components.js [Client Component SSR]
    ./node_modules/react-native-css-interop/dist/runtime/wrap-jsx.js [Client Component SSR]
    ./node_modules/react-native-css-interop/dist/runtime/jsx-dev-runtime.js [Client Component SSR]
    ./node_modules/nativewind/jsx-dev-runtime/index.js [Client Component SSR]
    ./apps/web/src/app/registry.tsx [Client Component SSR]
    ./apps/web/src/app/registry.tsx [Server Component]
    ./apps/web/src/app/layout.tsx [Server Component]

Next.js version: 15.5.0 (Turbopack)

I'd expect that this would work.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #202510191616~1761932270~24.04~b3a306c SMP PREEMPT_DYNAMIC Fri O
  Available memory (MB): 15659
  Available CPU cores: 20
Binaries:
  Node: 22.20.0
  npm: 10.9.3
  Yarn: N/A
  pnpm: 10.15.0
Relevant Packages:
  next: 16.1.0-canary.12 // Latest available version is detected (16.1.0-canary.12).
  eslint-config-next: 15.5.0
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

I've tried this on Next.js 15.5 and the latest canary as well. Seems like this might be an issue with parsing Flow syntax?

extent analysis

TL;DR

The issue is likely due to Turbopack not supporting Flow syntax, and switching to the next dev command without --turbo might resolve the issue.

Guidance

  • The error message "Parsing ecmascript source code failed" with "Expected ',', got '{'" suggests a syntax parsing issue, potentially related to Flow syntax not being supported by Turbopack.
  • Try reverting the change to /apps/web/package.json and run pnpm dev without the --turbo flag to see if the issue persists.
  • If the issue is indeed related to Turbopack, consider using the --no-turbo flag or exploring alternative build configurations that support Flow syntax.
  • Verify that the next version is compatible with the used react and react-dom versions.

Example

No code example is provided as the issue seems to be related to configuration and build settings rather than code-specific.

Notes

The issue might be specific to the combination of Next.js version, Turbopack, and Flow syntax. Further investigation into the compatibility of these components is necessary.

Recommendation

Apply workaround: Revert the change to /apps/web/package.json and run pnpm dev without the --turbo flag, as this might resolve the parsing issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING