Skip to content

[Bug]: v8 unable to transpile with babel/swc - CalendarYear.base.tsx Spread children error #25767

@Hotell

Description

@Hotell

Library

React / v8 (@fluentui/react)

Are you reporting Accessibility issue?

No response

Reproduction

Bug Description

Actual Behavior

using swc (swc-loader) in particular within react-18-tests-v8 apps webpack config throws error when importing from @fluentui/react. Same error happens if babel is used for transpilation.

ERROR in ../../packages/react/src/components/Calendar/CalendarYear/CalendarYear.base.tsx
Module build failed (from ../../node_modules/swc-loader/src/index.js):
Error: 
  × Spread children are not supported in React.
     ╭─[/Users/foo/fluentui/packages/react/src/components/Calendar/CalendarYear/CalendarYear.base.tsx:194:15]
 194 │ {...cellRow}
     · ────────────
     ╰────
 @ ../../packages/react/src/components/Calendar/CalendarYear/CalendarYear.tsx 4:0-55 5:35-51
 @ ../../packages/react/src/components/Calendar/CalendarMonth/CalendarMonth.base.tsx 7:0-60 127:49-61
 @ ../../packages/react/src/components/Calendar/CalendarMonth/CalendarMonth.tsx 2:0-57 5:36-53
 @ ../../packages/react/src/components/Calendar/Calendar.base.tsx 5:0-62 275:41-54
 @ ../../packages/react/src/components/Calendar/Calendar.tsx 3:0-47 5:31-43
 @ ../../packages/react/src/components/Calendar/index.ts 1:0-27 1:0-27
 @ ../../packages/react/src/Calendar.ts 1:0-44 1:0-44
 @ ../../packages/react/src/index.ts 8:0-9:44 8:0-9:44 8:0-9:44 8:0-9:44 8:0-9:44 8:0-9:44 8:0-9:44 8:0-9:44 8:0-9:44
 @ ./src/App.tsx 2:0-73 7:25-33 29:49-62 33:45-58
 @ ./src/index.tsx 4:0-28 6:99-102

Expected Behavior

v8 should work with swc

Logs

No response

Requested priority

Normal

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions