-
Notifications
You must be signed in to change notification settings - Fork 585
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
EAS build failed #6144
Comments
@darix795 Thank you for reporting. The file is generated during installation through a post-install script. Could you check if |
Yes, I confirm existing During test I've try to change babel module resolution. I try to add realm to module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
[
"module-resolver",
{
alias: {
"@fieldz/components": "./components",
"@fieldz/hooks": "./hooks",
"@fieldz/navigation": "./navigation",
"@fieldz/models": "./models",
"@fieldz/utils": "./utils",
"@fieldz/jobs": "./jobs",
},
extensions: [".ios.js", ".android.js", ".js", ".ts", ".tsx", ".json"],
},
],
[
"@tamagui/babel-plugin",
{
components: ["tamagui"],
config: "./tamagui.config.ts",
logTimings: true,
},
],
"macros",
"react-native-reanimated/plugin",
],
env: {
production: {
plugins: [["transform-remove-console", { exclude: ["error", "warn"] }]],
},
},
};
}; I noticed that, opposite write in issue, on cloud build everything work fine. This issue happening only EAS local build both platform android and ios. |
To successfully build the application, dependencies must be installed in the application folder (apps/mobile in your case). The workspace should contain the eas-build-pre-install.mjs script, which is responsible for modifying the package.json file inside the application folder before installing dependencies during the build process. It is possible that the script is not functioning correctly or not running at all. To troubleshoot this issue, examine the logs for the [READ_PACKAGE_JSON] step to determine which package.json file is being used for the build. You can also check the node_modules folder inside the application folder to see what was actually installed. |
I try various build and i noticed that on build folder (ex. |
Seems that on eas installation phase file not copy on import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Workaround
const jsonContent = `{"REALM_ANONYMIZED_BUNDLE_ID":"tkgif/+3l1e9wStGJp2TOngAK3UcQ2u7OM8ZYJU5JYo="}`;
const constantFileName = "realm-constants.json";
const realmPath = "../../../node_modules/realm";
const constantPath = path.join(__dirname, realmPath, constantFileName);
if (!fs.existsSync(constantPath)) {
fs.writeFile(constantPath, jsonContent, { flag: "wx" }, function (err) {
if (err) throw err;
});
}
Probably yarn, npm or eas configuration on my computer is broken somewhere, because on cloud eas build everything works fine. |
I'm currently having the same issue with my ios build. |
@fhb191309 meanwhile waiting fix you can use this workaround. Create a .mjs file, copy path and past into |
I have the same issue - also using Expo 49 with Realm 12 (12.2.1). It doesn't happen when built in EAS Cloud, but it happens when I make local builds using |
Just to add additional info; I'm running into this as well using Expo 49 and all Realm 12 versions The script by @darix795 worked well as a temp fix- just update the 'realmPath' to match where your node_modules folder is, for me in a Expo app, the package.json script and the node_modules are on the same level so mine is |
Version 12.3.1 has a fix for this. |
How frequently does the bug occur?
Description
I using Expo 49 with version 12.1 of realm. During android development with command
npx expo run:android
everything works fine, but when EAS build start errorUnable to resolve module ../realm-constants.json
occurs. On iOS looks good and build succeded.Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
Simply run
npx [email protected] build
Version
12.1.0
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
android
Build environment
expo@49
[email protected]
[email protected]
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: