nextjs - 💡(How to fix) Fix Turbopack Parsing Error with Multi-Line Import Braces [2 comments, 2 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#87931Fetched 2026-04-08 02:05:43
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2closed ×1issue_type_added ×1

Error Message

Turbopack throws an error: "Parsing ecmascript source code failed" and fails to compile the module.

Code Example

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025
  Available memory (MB): 58254
  Available CPU cores: 20
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.15.1
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  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/yunsii/turbopack-test

To Reproduce

  1. Start the application in development (next dev)
<img width="1242" height="506" alt="Image" src="https://github.com/user-attachments/assets/ab62732e-9543-45e9-867b-2cb9330e0527" />

Source code: https://github.com/yunsii/turbopack-test/blob/c226e9d1a7444784686bd4d0c152e41d8ae9d765/pages/index.page.tsx#L1-L3

Current vs. Expected behavior

Expected Behavior

Turbopack should correctly parse the import statement regardless of brace placement, as this is valid JavaScript/TypeScript syntax.

Actual Behavior

Turbopack throws an error: "Parsing ecmascript source code failed" and fails to compile the module.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025
  Available memory (MB): 58254
  Available CPU cores: 20
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.15.1
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  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)

Additional context

No response

extent analysis

TL;DR

The issue can likely be resolved by adjusting the import statement syntax in the index.page.tsx file to ensure compatibility with Turbopack's parsing.

Guidance

  • Review the index.page.tsx file and verify that the import statement is correctly formatted, considering the placement of braces and syntax.
  • Check the Turbopack documentation for any specific requirements or restrictions on import statement syntax.
  • Attempt to simplify the import statement to see if the issue persists, which can help isolate the cause.
  • Consider testing the application with a different bundler or build tool to determine if the issue is specific to Turbopack.

Example

No code snippet is provided as the issue is related to a specific file and syntax, and without the exact code, it's difficult to give a precise example.

Notes

The issue seems to be related to Turbopack's parsing of the import statement, and adjusting the syntax may resolve the issue. However, without more information about the specific import statement, it's difficult to provide a more detailed solution.

Recommendation

Apply workaround: Adjust the import statement syntax in the index.page.tsx file to ensure compatibility with Turbopack's parsing, as this is the most likely cause of the 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

nextjs - 💡(How to fix) Fix Turbopack Parsing Error with Multi-Line Import Braces [2 comments, 2 participants]