AJV issue with NativeWindUI + Bun
danstepanov opened this issue · comments
In an effort to run the build on my physical device, I am trying to create a development build via EAS (not locally) and am running into the following:
Build failed
Cannot find module 'ajv/dist/compile/codegen'
Require stack:
- /Users/expo/workingdir/build/node_modules/ajv-keywords/dist/definitions/typeof.js
- /Users/expo/workingdir/build/node_modules/ajv-keywords/dist/keywords/typeof.js
- /Users/expo/workingdir/build/node_modules/ajv-keywords/dist/keywords/index.js
- /Users/expo/workingdir/build/node_modules/ajv-keywords/dist/index.js
- /Users/expo/workingdir/build/node_modules/schema-utils/dist/validate.js
- /Users/expo/workingdir/build/node_modules/schema-utils/dist/index.js
- /Users/expo/workingdir/build/node_modules/expo-router/plugin/build/index.js
- /Users/expo/workingdir/build/node_modules/expo-router/app.plugin.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/node_modules/@expo/config-plugins/build/index.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/android/expoUpdates.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/utils/expoUpdates.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/builders/android.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/builders/index.js
- /usr/local/eas-build-worker/node_modules/@expo/build-tools/dist/index.js
- /usr/local/eas-build-worker/src/services/worker/dist/service.js
- /usr/local/eas-build-worker/src/services/worker/dist/ws.js
- /usr/local/eas-build-worker/src/services/worker/dist/main.js
My configuration
Your project configuration:
{
projectName: 'my-expo-app',
packages: [
{
name: 'nativewindui',
type: 'styling',
options: { selectedComponents: [ 'activity-indicator' ] }
},
{
name: 'expo-router',
type: 'navigation',
options: { type: 'drawer + tabs' }
}
],
flags: {
noGit: false,
noInstall: false,
overwrite: false,
importAlias: true,
packageManager: 'bun'
}
}```
## Build details
<img width="722" alt="Screenshot 2024-04-21 at 9 21 06 PM" src="https://github.com/danstepanov/create-expo-stack/assets/5482800/d044fa47-de1b-4c03-a4b8-b799d9d6aae9">
<img width="756" alt="Screenshot 2024-04-21 at 9 21 31 PM" src="https://github.com/danstepanov/create-expo-stack/assets/5482800/7d135aba-5d84-429b-8c5c-38f1334584b2">
Seems like this line isn't being included in the package.json for this project
https://github.com/danstepanov/create-expo-stack/blob/b1717c9f241ca377b8e7bbd9bb79556719d33034/cli/src/templates/base/package.json.ejs#L145
This issue is relevant oven-sh/bun#9135
We can likely bypass this by locking a version of bun (maybe 1.014?) which I only know how to do locally, not sure how to lock that in EAS. For now, I recommend anyone using CES to use npm or yarn.
Bun v1.0.22 confirmed to work. You can also lock the bun version in your eas.json, for EAS purposes. https://docs.expo.dev/guides/using-bun/#use-bun-for-eas-builds
We should add something that modifies your eas.json if you initialize a project with that file.
Tracked here: oven-sh/bun#9135
Closing this here as this is an issue with Bun, itself. Will track the above issue in Bun and will post an update on Discord and Twitter when I see this resolved.