Skip to content

AWS Amplify not building on Expo Web #14408

Open
@DanWilkins2107

Description

@DanWilkins2107

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Not applicable

Amplify Version

v6

Amplify Categories

auth

Backend

Other

Environment information

# Put output below this line
  System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 4.93 GB / 15.72 GB
  Binaries:
    Node: 22.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (136.0.3240.50)
  npmPackages:
    @aws-amplify/react-native: ^1.1.9 => 1.1.9
    @babel/core: ^7.25.2 => 7.27.1
    @expo/vector-icons: ^14.1.0 => 14.1.0
    @react-native-async-storage/async-storage: ^2.1.2 => 2.1.2
    @react-native-community/netinfo: ^11.4.1 => 11.4.1
    @react-navigation/bottom-tabs: ^7.3.10 => 7.3.13
    @react-navigation/elements: ^2.3.8 => 2.4.2
    @react-navigation/native: ^7.1.6 => 7.1.9
    @types/react: ~19.0.10 => 19.0.14
    aws-amplify: ^6.14.4 => 6.14.4
    aws-amplify/adapter-core:  undefined ()
    aws-amplify/adapter-core/internals:  undefined ()
    aws-amplify/analytics:  undefined ()
    aws-amplify/analytics/kinesis:  undefined ()
    aws-amplify/analytics/kinesis-firehose:  undefined ()
    aws-amplify/analytics/personalize:  undefined ()
    aws-amplify/analytics/pinpoint:  undefined ()
    aws-amplify/api:  undefined ()
    aws-amplify/api/internals:  undefined ()
    aws-amplify/api/server:  undefined ()
    aws-amplify/auth:  undefined ()
    aws-amplify/auth/cognito:  undefined ()
    aws-amplify/auth/cognito/server:  undefined ()
    aws-amplify/auth/enable-oauth-listener:  undefined ()
    aws-amplify/auth/server:  undefined ()
    aws-amplify/data:  undefined ()
    aws-amplify/data/server:  undefined ()
    aws-amplify/datastore:  undefined ()
    aws-amplify/in-app-messaging:  undefined ()
    aws-amplify/in-app-messaging/pinpoint:  undefined ()
    aws-amplify/push-notifications:  undefined ()
    aws-amplify/push-notifications/pinpoint:  undefined ()
    aws-amplify/storage:  undefined ()
    aws-amplify/storage/s3:  undefined ()
    aws-amplify/storage/s3/server:  undefined ()
    aws-amplify/storage/server:  undefined ()
    aws-amplify/utils:  undefined ()
    eslint: ^9.25.0 => 9.27.0
    eslint-config-expo: ~9.2.0 => 9.2.0
    expo: ~53.0.9 => 53.0.9
    expo-blur: ~14.1.4 => 14.1.4
    expo-constants: ~17.1.6 => 17.1.6
    expo-font: ~13.3.1 => 13.3.1
    expo-haptics: ~14.1.4 => 14.1.4
    expo-image: ~2.1.7 => 2.1.7
    expo-linking: ~7.1.5 => 7.1.5
    expo-router: ~5.0.6 => 5.0.7
    expo-splash-screen: ~0.30.8 => 0.30.8
    expo-status-bar: ~2.2.3 => 2.2.3
    expo-symbols: ~0.4.4 => 0.4.4
    expo-system-ui: ~5.0.7 => 5.0.7
    expo-web-browser: ~14.1.6 => 14.1.6
    react: 19.0.0 => 19.0.0
    react-dom: 19.0.0 => 19.0.0
    react-native: 0.79.2 => 0.79.2
    react-native-gesture-handler: ~2.24.0 => 2.24.0
    react-native-get-random-values: ^1.11.0 => 1.11.0
    react-native-reanimated: ~3.17.4 => 3.17.5
    react-native-safe-area-context: 5.4.0 => 5.4.0
    react-native-screens: ~4.10.0 => 4.10.0
    react-native-web: ~0.20.0 => 0.20.0
    react-native-webview: 13.13.5 => 13.13.5
    typescript: ~5.8.3 => 5.8.3
  npmGlobalPackages:
    firebase-tools: 14.4.0


Describe the bug

When I create an expo app (npx create-expo-app@latest ), and then try to add AWS amplify (by running npm install aws-amplify @aws-amplify/react-native @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values) as described in the docs. When I run npx expo start --web, I get a metro build error saying "Metro error: Cannot read properties of undefined (reading 'v1')". Further stack trace here:

TypeError: Cannot read properties of undefined (reading 'v1')
    at factory (C:\Users\danwi\AmplifyAuthTest\node_modules\@aws-amplify\core\node_modules\uuid\wrapper.mjs:2:24)
    at loadModuleImplementation (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:277:5)
    at guardedLoadModule (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:184:12)
    at require (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:92:7)
    at factory (C:\Users\danwi\AmplifyAuthTest\node_modules\@aws-amplify\core\dist\esm\singleton\Amplify.mjs:9:1)
    at loadModuleImplementation (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:277:5)
    at guardedLoadModule (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:184:12)
    at require (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:92:7)
    at factory (C:\Users\danwi\AmplifyAuthTest\node_modules\@aws-amplify\core\dist\esm\index.mjs:3:1)
    at loadModuleImplementation (C:\Users\danwi\AmplifyAuthTest\node_modules\metro-runtime\src\polyfills\require.js:277:5)

Expected behavior

The website should load without a build error.

Reproduction steps

  1. Create expo app
  2. Do the installation mentioned above
  3. Run the command mentioned in the description

Code Snippet

// Put your code below this line.
Changed App.js to

import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
import { useFonts } from 'expo-font';
import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import 'react-native-reanimated';

import { useColorScheme } from '@/hooks/useColorScheme';
import { Amplify } from 'aws-amplify'

Amplify.configure({
  Auth: {
    Cognito: {
      userPoolId: '<redacted>',
      userPoolClientId: '<redacted>',
    }
  }
})

export default function RootLayout() {
  const colorScheme = useColorScheme();
  const [loaded] = useFonts({
    SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
  });

  if (!loaded) {
    // Async font loading only occurs in development.
    return null;
  }

  return (
    <ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
      <Stack>
        <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
        <Stack.Screen name="+not-found" />
      </Stack>
      <StatusBar style="auto" />
    </ThemeProvider>
  );
}
`

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildRelated to build issuesCoreRelated to core Amplify issuesReact NativeReact Native related issuefeature-requestRequest a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions