Open spartanlync opened 3 days ago
I was able to reproduce the same issue from Ignite CLI version 10.0.4
. When I run npm ls ajv
from the Ignited project, I get the following output:
ignite-expo-ble-app@0.0.1 /Users/tylerwilliams/ignite-expo-ble-app
├─┬ eslint@8.57.1
│ ├─┬ @eslint/eslintrc@2.1.4
│ │ └── ajv@6.12.6 deduped
│ └── ajv@6.12.6
├─┬ expo-build-properties@0.12.5
│ └── ajv@8.17.1
└─┬ expo-router@3.5.24
└─┬ schema-utils@4.2.0
├─┬ ajv-formats@2.1.1
│ └── ajv@8.17.1
├─┬ ajv-keywords@5.1.0
│ └── ajv@6.12.6 deduped invalid: "^8.8.2" from node_modules/ajv-keywords
└── ajv@8.17.1
Although it looks like maybe this is a peer dependency resolution issue. It looks like you're using Node, not Bun, but that may actually be the culprit: https://github.com/expo/expo/issues/29150
As a quick workaround, if you install ajv as a devDependency in your project, you can force things to work:
npm install --save-dev ajv@^8 --legacy-peer-deps
npm run ios
That worked for me on my reproducer, but it's not really addressing the root issue.
Thanks for the response. As a newbie, I am still a bit confused as to how to apply your suggestion.
npm install --save-dev ajv@^8 --legacy-peer-deps
npm run ios
Keep in mind, I only ran one automated command that is supposed to build the boilerplate project
npx ignite-cli@latest new ignite-expo-ble-app
So after that one command fails, and I patch the interrupted installation with your suggestion How do I resume the operation where that one automated command process failed?
Do I just
cd ignite-expo-ble-app
npx ignite-cli@latest new .
Is it supposed to pick up where it left off, with my manually patched package.json?
Please advise.
Yea, I followed my own suggestion. Unfortunately the project creation did not resume, but failed with another error.
LMIT-MacBook-Air!valor [~/Documents/Projects/my-react-native-studio/ignite-expo-ble-app]>npx ignite-cli@latest new .
(node:20374) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
The project name can only contain alphanumeric characters and underscore, but must not begin with a number.
So this patch / fix somehow needs to be applied to the package.json, BEFORE I can run
npx ignite-cli@latest new ignite-expo-ble-app
Hey @spartanlync - I think I've figured out the issue(s). I was able to reproduce the errors you hit, and resolve them locally. I think there are actually three intersecting bugs. Two of them are from Ignite, and one requires a small adjustment on your side.
_
are invalid characters for bundle identifiers.That said, here are a series of steps that I believe will fix your issues. I was able to get an Ignite project with your chosen settings running on my own local environment with these steps. We will still want to resolve the peer dependencies and template issues on our end, but hopefully this unblocks you, and anyone else trying to use the experimental support for Expo Router.
First, remove your existing project with rm -rf ignite-expo-ble-app
. This will delete files, so if you've done some work, move it to another location instead of deleting so you can pull that work over. I get the sense you haven't made any changes yet, so it's probably easiest to start from a blank slate.
Next, run npx ignite-cli@latest new ignite-expo-ble-app
with these options:
✅ What bundle identifier? · com.igniteexpobleapp
✅ Where do you want to start your project? · /Users/tylerwilliams/ignite-expo-ble-app
✅ How do you want to manage Native code? · cng
✅ Do you want to initialize a git repository? (Y/n) · Yes
✅ Remove demo code? We recommend leaving it in if it's your first time using Ignite (y/N) · No
✅ Which package manager do you want to use? · npm
✅ Do you want to install dependencies? (Y/n) · Yes
✅ [Experimental] Expo Router for navigation? (y/N) · Yes
✅ [Experimental] the New Architecture? (y/N) · Yes
Notice the updated bundle identifier: com.spartanlync.igniteexpobleapp
rather than your original com.spartanlync.ignite_expo_ble_app
. I think those underscores were the follow-up issue you ran into. The Ignite CLI will probably promp with com.igniteexpobleapp
, which would be suitable as well.
I think the root of your original issue is that there's some kind of peer dependency problem with ESLint and Expo Router. So go into the directory with cd ignite-expo-ble-app
. Then run npm install --legacy-peer-deps
. This is a bit of a hack, but from what I can tell, it resolves the issue. We will have to address the root cause on our end.
Up next, let's force your project to have the latest version of ajv
with npm install --save-dev ajv@^8 --legacy-peer-deps
. This will make ajv
a direct devDependency
in your project, so the resolution will use the appropriate version across all sub-dependencies. Again, this is a hack and we will need to fix the root cause, but hopefully this unblocks you for now.
Finally, we have some issues in our experimental templates. We'll have to update those, but you can fix it in your own project locally. In src/app/_layout.tsx
, you'll need to make two changes:
require("src/devtools/ReactotronConfig.ts")
to require("../../app/devtools/ReactotronConfig")
export { ErrorBoundary } from "@/components/ErrorBoundary/ErrorBoundary" to export { ErrorBoundary } from "@/screens/ErrorScreen/ErrorBoundary"
Then you should be able to get the app running, assuming your React Native development environment is correctly set up: https://reactnative.dev/docs/environment-setup. You can run npm run ios
or npm run android
and things should build and run. Here's a screenshot of it working on my machine:
Let me know if you experience any additional issues. Sorry for the inconvenience. Experimental features often have some sharp edges. We will smooth 'em down!
I think this may be related to what we had to do in https://github.com/infinitered/ignite/issues/2818, but from what I can tell that code hasn't changed or regressed. I'm going to double check to make sure --legacy-peer-deps
is getting called from npm
with the experimental flags as well.
Ok, so we're definitely calling --legacy-peer-deps
as expected. But perhaps the legacy peer dependency resolution works for the initial problem in https://github.com/infinitered/ignite/issues/2818, but breaks this behavior for ajv
with ESLint when we choose Expo Router and install with npm.
I think we can just add ajv
as a devDependency
and smooth this over. I'll put together a PR on that one.
Hey @coolsoftwaretyler, following your suggestions I was successful in getting the demo app running
I don't feel comfortable trusting this project until your suggested patches to
ajv
as a devDependency
npx ignite-cli@latest new
is successful and all post-install tests validate the installationI will explorer the framework to understand how it works, but will hold off on using it for my next project until it's Expo integration is more stable
Thanks for all your help, and glad i could contribute to a better product
Thanks @spartanlync. Sorry it wasn't a good fit and hopefully you'll consider us again soon.
Describe the bug
Hello, Was interested in exploring this framework by creating a project and trying it out for myself.
Unfortunately, creating my demo project failed with the following error and I could not find any reference to this issue being raised on GitHub.
CommandError: Cannot find module 'ajv/dist/compile/codegen'
Please see my screenshot below of trying to build my ignite project using the latest code. Note: I do not have ignite-cli installed in my computer
Doing some digging, i found two articles on a solution.
But these fixes requires a package.json dependancy fix from ^6 to ^8, which is outside my scope for ignite.
So before I abandon this exploration of ignite, I thought i would post what i experienced and give the community a chance to resolve.
Any suggestions on next steps?
Text of installation and error below
Screenshot of installation and error below
Ignite version
10.0.4
Additional info