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

[ios.dangerous]: withIosDangerousBaseMod: Cannot find module 'chalk' #1034

Closed
innonguyen opened this issue Mar 27, 2022 · 12 comments
Closed
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@innonguyen
Copy link

Build/Submit details page URL

https://expo.dev/accounts/pavnlimitedcompany/projects/tlcn/builds/2b41f7c0-29c4-4313-a450-f38396465b2e

Summary

2 days ago, I built with eas build successfully. However, I got the below error for today's build

[PREBUILD] ✖ Config sync failed [PREBUILD] [13:29:06] [ios.dangerous]: withIosDangerousBaseMod: Cannot find module 'chalk'

I don't change anything in my source code. I think it's a build process bug.

Managed or bare?

Managed

Environment

expo-env-info 1.0.2 environment info:
System:
OS: macOS 11.6.4
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
Yarn: 1.22.17 - ~/.yarn/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
Watchman: 2021.09.13.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
npmPackages:
expo: ^43.0.0 => 44.0.6
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-web: 0.17.1 => 0.17.1
npmGlobalPackages:
eas-cli: 0.48.2
expo-cli: 5.3.0
Expo Workflow: managed

Error output

[PREBUILD] - Config syncing
[PREBUILD] ✖ Config sync failed
[PREBUILD] [13:29:06] [ios.dangerous]: withIosDangerousBaseMod: Cannot find module 'chalk'
[PREBUILD] Require stack:
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/@expo/image-utils/build/Image.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/@expo/image-utils/build/index.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/node_modules/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/node_modules/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/plugin/build/withSplashScreen.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/app.plugin.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config/build/plugins/withConfigPlugins.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config/build/Config.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config/build/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/build/getPrebuildConfig.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/build/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/configureProjectAsync.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/prebuildAppAsync.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/prebuildAsync.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/prebuild.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/exp.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/bin/expo.js
[PREBUILD] [13:29:06] Error: [ios.dangerous]: withIosDangerousBaseMod: Cannot find module 'chalk'
[PREBUILD] Require stack:
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/@expo/image-utils/build/Image.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/@expo/image-utils/build/index.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/node_modules/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/node_modules/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/plugin/build/withSplashScreen.js
[PREBUILD] - /private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/expo-splash-screen/app.plugin.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config-plugins/build/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config/build/plugins/withConfigPlugins.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config/build/Config.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/node_modules/@expo/config/build/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/build/getPrebuildConfig.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/prebuild-config/build/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/configureProjectAsync.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/prebuildAppAsync.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/prebuildAsync.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/eject/prebuild.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/commands/index.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/build/exp.js
[PREBUILD] - /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/expo-cli/bin/expo.js
[PREBUILD] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
[PREBUILD] at Function.Module._load (internal/modules/cjs/loader.js:725:27)
[PREBUILD] at Module.require (internal/modules/cjs/loader.js:952:19)
[PREBUILD] at require (internal/modules/cjs/helpers.js:88:18)
[PREBUILD] at Object. (/private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/@expo/image-utils/src/Image.ts:1:1)
[PREBUILD] at Module._compile (internal/modules/cjs/loader.js:1063:30)
[PREBUILD] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
[PREBUILD] at Module.load (internal/modules/cjs/loader.js:928:32)
[PREBUILD] at Function.Module._load (internal/modules/cjs/loader.js:769:14)
[PREBUILD] at Module.require (internal/modules/cjs/loader.js:952:19)
[PREBUILD] at require (internal/modules/cjs/helpers.js:88:18)
[PREBUILD] at Object. (/private/var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/eas-build-local-nodejs/ac25c6d9-c55c-4706-b947-85b48c0f49bb/build/node_modules/@expo/image-utils/src/index.ts:2:1)
[PREBUILD] at Module._compile (internal/modules/cjs/loader.js:1063:30)
[PREBUILD] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
[PREBUILD] at Module.load (internal/modules/cjs/loader.js:928:32)
[PREBUILD] at Function.Module._load (internal/modules/cjs/loader.js:769:14)
[PREBUILD]
Error: bash exited with non-zero code: 1
at ChildProcess.completionListener (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/spawn-async/build/spawnAsync.js:43:23)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
...
at spawnAsync (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/spawn-async/build/spawnAsync.js:8:21)
at spawn (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/turtle-spawn/dist/index.js:17:47)
at LocalExpoCliEjectProvider.runEject (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/dist/eject.js:22:42)
at /Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/builders/ios.js:32:41
at BuildContext.runBuildPhase (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/context.js:48:34)
at Object.iosBuilder (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/builders/ios.js:28:23)
at async buildIosAsync (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/dist/ios.js:49:27)
at async buildAsync (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/dist/build.js:28:32)
at async main (/Users/namanh/.npm/_npx/10554/lib/node_modules/eas-cli-local-build-plugin/dist/main.js:16:9)
[CLEAN_UP_CREDENTIALS] Destroying keychain - /var/folders/bk/2p_w9p8j3ys3f786dc6t94dw0000gp/T/turtle-v2-ca713dba-6dfe-4e88-98da-f096a763a0a9.keychain
[CLEAN_UP_CREDENTIALS] Removing provisioning profile

Build failed
bash exited with non-zero code: 1
Error: npx exited with non-zero code: 1

Reproducible demo or steps to reproduce from a blank project

Step 1: eas build --profile internal
Step 2: get the above error

@innonguyen innonguyen added the needs review Issue is ready to be reviewed by a maintainer label Mar 27, 2022
@KWcDP6hz3
Copy link

I can confirm this issue. This seem to occur for iOS as well as Android. Two days ago I was able to build the same app without any issues. Running eas build with '--clear-cache' doesn't make a difference.

@innonguyen
Copy link
Author

Yes, I got into the problem with both iOS and Android.

@RoccoDocco
Copy link

RoccoDocco commented Mar 27, 2022

Same here. Was able to build a few days ago and I am suddenly getting this error.

Android gets the same error: "withAndroidDangerousBaseMod: Cannot find module 'chalk'"

EDIT: "npm i chalk" actually fixed this

@innonguyen
Copy link
Author

@RoccoDocco Did you added chalk in project dependencies?

If yes, it might fix this error but it shouldn't be the solution. I, honestly, don't want any unknown package in my project dependency list. Expo team should have another solution.

@KWcDP6hz3
Copy link

KWcDP6hz3 commented Mar 28, 2022

@RoccoDocco thanks, this workaround seems to be fixing the issue for now.

@innonguyen I've added chalk to my project dependencies before building using 'eas build'. At first I got some errors about chalk being 'esm only': 'Must use import to load ES Module'. So I had to install chalk 4.1.2 (npm install chalk@4.1.2) after which everything worked again for me.

Still I don't like adding packages to my project that I don't use myself, so I'm looking forward to a solution on this issue.

@wkozyra95
Copy link
Contributor

@innonguyen I copied the content of your package.json (dependencies + devDependencies) and I couldn't reproduce the issue, plus I noticed that you have very old eas-cli in your dev dependencies(I don't expect for that to be the issue, but if you are using it then you might face some problems)

I couldn't reproduce that exact error, but it looks like if you are using npm, the install step was using npm, but prebuild was running yarn which might be a reason for that issue. Fix for that was deployed, so please rerun your builds to check if the issue is resolved.

@innonguyen
Copy link
Author

@wkozyra95

Firstly, the eas-cli version in devDependencies is not what i'm using. I run this command and it showed like this

 ~ % eas -v
eas-cli/0.48.2 darwin-x64 node-v14.16.0

Secondly, I used yarn for entire process.

I think the problem comes from your build process updates while other people are getting into the same issue with me. And we are all had no issue 2 days before. You should rollback your build process.

@wkozyra95
Copy link
Contributor

Secondly, I used yarn for the entire process.

No, both your current builds and old ones (from few days back are using npm). Note that if you are not committing your yarn.lock, it wont be uploaded to eas(it always worked this way)

You should rollback your build process.

I'm assuming that changes that were just deployed will fix the issue, if not please post here.

@KWcDP6hz3
Copy link

@wkozyra95 For me those changes you mentioned fixed the issue. I was using npm but the prebuild on eas was using yarn (and was complaining about that). This warning is gone now and I get no error for chalk anymore.

Thank you very much!

@innonguyen
Copy link
Author

@KWcDP6hz3 How to force prebuild using yarn?

@wkozyra95
Copy link
Contributor

@innonguyen eas build will use yarn if you have yarn.lock in the repo

@innonguyen
Copy link
Author

I confirmed this issue resolved by doing these following steps:

Option 1:
Step 1: Remove yarn.lock or *.lock in .gitignore file
Step 2: Commit the code (with yarn.lock)
Step 3: eas build

Option 2:
Step 1: Add chalk library (yarn add chalk@4.1.2 / npm i chalk@4.1.2)
Step 2: eas build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants