facebook / hermes

A JavaScript engine optimized for running React Native.
https://hermesengine.dev/
MIT License
9.41k stars 596 forks source link

spread arguments throw "constructor not callable" when `Array` variable declared #1376

Closed tim-smart closed 4 weeks ago

tim-smart commented 4 weeks ago

Bug Description

React Native version: 0.73.6 OS: ios 17.4 Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64

Steps To Reproduce

  1. Run the following app:
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";

export const Array = {};

export default function App(...params: Array<string>) {
  console.log(params);
  return (
    <View style={styles.container}>
      <Text>Open up App.tsx to start working on your app!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
});

The Expected Behavior

App should run without issues

tim-smart commented 4 weeks ago

Closing I think this is actually a bundler issue.