Skip to content

FluentUI in Expo project, pragma and pragmaFrag cannot be set when runtime is automatic #1891

@jbizcloud

Description

@jbizcloud

Willing to submit a PR to fix?

  • I am willing to submit a PR to fix

Requested priority

Normal

Products/applications affected

FluentUI not able to render in Expo project.

Started Metro Bundler
iOS Bundling failed 3058ms
node_modules\@fluentui-react-native\button\lib-commonjs\deprecated\Button.js: D:\rep\ExpoLab\JSlab\ExpoLab\node_modules\@fluentui-react-native\button\lib-commonjs\deprecated\Button.js: pragma and pragmaFrag cannot be set when runtime is automatic.
> 1 | "use strict";
    | ^
  2 | var __assign = (this && this.__assign) || function () {
  3 |     __assign = Object.assign || function(t) {
  4 |         for (var s, i = 1, n = arguments.length; i < n; i++) {
SyntaxError: D:\rep\ExpoLab\JSlab\ExpoLab\node_modules\@fluentui-react-native\button\lib-commonjs\deprecated\Button.js: pragma and pragmaFrag cannot be set when runtime is automatic.

Package version(s)

"@fluentui/react-native": "^0.31.5",

OS version(s)

Windows 11, MacOS Monterey

Platform

  • iOS
  • macOS
  • win32
  • windows
  • android

Xcode version

14

Please provide a reproduction of the bug

  1. Instal Expo
    https://docs.expo.dev/get-started/installation/

  2. Create new React Native app
    npx create-expo-app my-app

  3. Install Fluent UI
    npm i @fluentui/react-native

  4. Add Checkbox to App.js

import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, TextInput, Entry } from 'react-native';
**import { Checkbox } from '@fluentui/react-native';**

export default function App() {
  return (
    <View >
          
      **<Checkbox label="Hello World Checkbox" />**

      <StatusBar style="auto" />
    </View>
  );
}
  1. Start project:
    npm start

  2. Error in terminal

Started Metro Bundler
iOS Bundling failed 3058ms
node_modules\@fluentui-react-native\button\lib-commonjs\deprecated\Button.js: D:\rep\ExpoLab\JSlab\ExpoLab\node_modules\@fluentui-react-native\button\lib-commonjs\deprecated\Button.js: pragma and pragmaFrag cannot be set when runtime is automatic.
> 1 | "use strict";
    | ^
  2 | var __assign = (this && this.__assign) || function () {
  3 |     __assign = Object.assign || function(t) {
  4 |         for (var s, i = 1, n = arguments.length; i < n; i++) {
SyntaxError: D:\rep\ExpoLab\JSlab\ExpoLab\node_modules\@fluentui-react-native\button\lib-commonjs\deprecated\Button.js: pragma and pragmaFrag cannot be set when runtime is automatic.

Actual behavior

App error message

Expected behavior

App should display the added Checkbox

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