I have an expo react native project which shares a common directory with a react web frontend. The common director is in src/common
and it is a separate repository, and I use it in the react native project as a git submodule.
I was building fine, but I guess there was an update that broke my builds recently.
The build failes on the first line that is importing from the common directory.
Here is the relevant log from the build (Build Step: Run gradlew)
Welcome to Metro!
Fast - Scalable - Integrated
[stderr] error Unable to resolve module ./src/common/providers/APIErrorProvider from /home/expo/workingdir/build/App.js:
[stderr] None of these files exist:
[stderr] * src/common/providers/APIErrorProvider(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
[stderr] * src/common/providers/APIErrorProvider/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
[stderr] 8 | // import { StatusBar } from './src/components/status-bar.component'; for some reason this breaks the app
[stderr] 9 | import { Provider } from 'react-redux'
[stderr] > 10 | import APIErrorProvider from './src/common/providers/APIErrorProvider';
[stderr] | ^
[stderr] 11 | import { PersistGate } from 'redux-persist/integration/react';
[stderr] 12 | import configureStore from './src/native-common/storage/configureStore';
[stderr] 13 | import { useFonts, TitilliumWeb_200ExtraLight, TitilliumWeb_300Light, TitilliumWeb_400Regular, TitilliumWeb_700Bold } from '@expo-google-fonts/titillium-web';.
Error: Unable to resolve module ./src/common/providers/APIErrorProvider from /home/expo/workingdir/build/App.js:
None of these files exist:
* src/common/providers/APIErrorProvider(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
* src/common/providers/APIErrorProvider/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
8 | // import { StatusBar } from './src/components/status-bar.component'; for some reason this breaks the app
9 | import { Provider } from 'react-redux'
> 10 | import APIErrorProvider from './src/common/providers/APIErrorProvider';
| ^
11 | import { PersistGate } from 'redux-persist/integration/react';
12 | import configureStore from './src/native-common/storage/configureStore';
13 | import { useFonts, TitilliumWeb_200ExtraLight, TitilliumWeb_300Light, TitilliumWeb_400Regular, TitilliumWeb_700Bold } from '@expo-google-fonts/titillium-web';
at ModuleResolver.resolveDependency (/home/expo/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:136:15)
at DependencyGraph.resolveDependency (/home/expo/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
at Object.resolve (/home/expo/workingdir/build/node_modules/metro/src/lib/transformHelpers.js:129:24)
at resolve (/home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
at /home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
at Array.reduce (<anonymous>)
at resolveDependencies (/home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
at processModule (/home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
at async addDependency (/home/expo/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
at async Promise.all (index 2)
info Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
8 actionable tasks: 8 executed
Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.
[stderr] > Process 'command 'node'' finished with non-zero exit value 1
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 26s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.