Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native 0.76.4 + Expo SDK 52 broke Expo Image and likely other packages #350

Closed
christianjuth opened this issue Dec 28, 2024 · 1 comment · Fixed by #354 or #360
Closed

React Native 0.76.4 + Expo SDK 52 broke Expo Image and likely other packages #350

christianjuth opened this issue Dec 28, 2024 · 1 comment · Fixed by #354 or #360

Comments

@christianjuth
Copy link

I suspect this affects more packages then just expo-image.

Steps to reproduce:

  1. Clone reproduction repo
  2. Run yarn install
  3. Run yarn dev
  4. Type qr and launch Expo Go on iOS

I get the following error

✓ 604 modules transformed.
x Build failed in 1.87s
 Error building React Native bundle
node_modules/expo/src/winter/runtime.native.ts (6:9): "polyfillGlobal" is not exported by "virtual:rn-internals:react-native/Libraries/Utilities/PolyfillFunctions", imported by "node_modul
es/expo/src/winter/runtime.native.ts".
file: /Users/personal-projects/one-expo-52-bug/node_modules/expo/src/winter/runtime.native.ts:6:9

4: // @ts-ignore: PolyfillFunctions does not have types exported
5: import { polyfillGlobal as installGlobal } from 'react-native/Libraries/Utilities/PolyfillFunctions';
6:
   ^
7: import { installFormDataPatch } from './FormData';
8: // Add a well-known shared symbol that doesn't show up in iteration or inspection

    at getRollupError (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.error (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:15655:16)
    at Module.traceVariable (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:16104:29)
    at ModuleScope.findVariable (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:13887:39)
    at FunctionScope.findVariable (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:5306:38)
    at FunctionBodyScope.findVariable (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:5306:38)
    at Identifier.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:5089:40)
    at CallExpression.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:2676:23)
    at CallExpression.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:11313:15)
    at ExpressionStatement.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:2676:23)
    at BlockStatement.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:2672:28)
    at FunctionDeclaration.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:2676:23)
    at Program.bind (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:2672:28)
    at Module.bindReferences (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:15634:18)
    at Graph.sortModules (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:21163:20)
    at Graph.build (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:21066:14)
    at async file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:21754:13
    at async catchUnfinishedHookActions (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:21220:16)
    at async rollupInternal (file:///Users/personal-projects/one-expo-52-bug/node_modules/rollup/dist/es/shared/node-entry.js:21749:5)
    at async buildEnvironment (file:///Users/personal-projects/one-expo-52-bug/node_modules/vite/dist/node/chunks/dep-0AosnpPU.js:50850:14)
    at async getReactNativeBundle (file:///Users/personal-projects/one-expo-52-bug/node_modules/vxrn/dist/utils/getReactNativeBundle.mjs:40:19)
    at async file:///Users/personal-projects/one-expo-52-bug/node_modules/vxrn/dist/plugins/reactNativeDevServer.mjs:100:31
    at async handleRNBundle (file:///Users/personal-projects/one-expo-52-bug/node_modules/vxrn/dist/plugins/reactNativeDevServer.mjs:95:26) {
  binding: 'polyfillGlobal',
  code: 'MISSING_EXPORT',
  exporter: 'virtual:rn-internals:react-native/Libraries/Utilities/PolyfillFunctions',
  id: '/Users/personal-projects/one-expo-52-bug/node_modules/expo/src/winter/runtime.native.ts',
  url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module',
  pos: 22,
  loc: {

The weird thing is that react-native/Libraries/Utilities/PolyfillFunctions does export polyfillGlobal but it's a CJS export. React Native seems to mix ESM and CJS so maybe that's the issue?

https://www.unpkg.com/browse/[email protected]/Libraries/Utilities/PolyfillFunctions.js

@zetavg
Copy link
Collaborator

zetavg commented Jan 1, 2025

Just tested v1.1.378 with expo-image's example and it seems to be working, but there're some errors that I'm not sure if those will break things and still in the progress of fixing.

Screen.Shot.2025-01-01.06.59.21.PM.Simulator.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants