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

monorepo squashed commit #59

Draft
wants to merge 1 commit into
base: monorepo
Choose a base branch
from
Draft

Conversation

shuesken
Copy link
Contributor

No description provided.

@shuesken shuesken mentioned this pull request Jan 14, 2025
@shuesken
Copy link
Contributor Author

Replicating Callum's comment from other PR here:

This isn't just a monorepo PR oder? It seems to also break running the app via Expo Go. That means that the "normal" development process won't work. Now everybody needs to run a local build. I also don't see that documented anywhere in the readme.

I think we should be very careful before we merge. Maybe it makes sense to wait until after nostroots 7, or to make sure we have a bulletproof setup working that everybody can replicate.

When I try to build android locally, I get this error:

pkgx +eas eas build --platform android --local
The EAS build profile does not specify a Node.js version. Using the version specified in .nvmrc: 20.18.1
Failed to read the app config from the project using "npx expo config" command: spawn npx ENOENT.
Falling back to the version of "@expo/config" shipped with the EAS CLI.
We detected that you are building for the "store" distribution. Resolving the environment for environment variables used during the build t.
No environment variables with visibility "Plain text" and "Sensitive" found for the "production" environment on EAS servers.

✔ Incremented versionCode from 6 to 7.
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials iJvIg2YPf5 (default)
✔ Compressed project files 1s (49.1 MB)
✔ Computed project fingerprint
spawn npm ENOENT
    Error: build command failed.

@shuesken
Copy link
Contributor Author

@chmac I'd like to find something that works on more than just my machine before I write up a Readme. The PR also does some config for making a device build, because that needs to work with the monorepo. Our current setup doesn't allow for building because the cross-linked package cannot be found, so I want to make sure the monorepo lets the user build things.

This is not meant to break the Expo Go flow. It continues to work on my machine with this branch. I do have to specify whether I want to use Expo Go or device build though both in the app and on the CLI when launching, but imagine that can be handled by passing a parameter as well. Can you say what's broken about Expo Go for you?

The spawn npm ENOENT is weird. Seems that's usually caused by some path not being properly set relative/absolute, or some cache not being cleared. Did you run this in a fresh directory? Can you try prefixing DEBUG=* to that command?

@shuesken shuesken requested a review from chmac January 14, 2025 10:49
@shuesken shuesken changed the title monorepo squashe commit monorepo squashed commit Jan 14, 2025
@chmac
Copy link
Member

chmac commented Jan 15, 2025

There's a mistake with the branches here, you're merging into the monorepo branch on this repo from your monorepo branch, but it should target main I think no?

@chmac
Copy link
Member

chmac commented Jan 15, 2025

@shuesken wanted me to test:

cd nr-app
pnpm install
pnpm run start
pnpm run android
eas build #select platform android
eas build

@chmac
Copy link
Member

chmac commented Jan 15, 2025

I get this error:

DEBUG='*' pkgx +pnpm pnpm run android

> [email protected] android ~/tmp/trash/nr-mono/nr-app
> expo run:android

  expo:telemetry Switching strategy from detached to instant +0ms
  expo:telemetry Recording 1 event(s) +16ms
  expo:env No environment variables loaded from .env files. +0ms
- Creating native directory (./android)
spawn npm ENOENT
- Creating native directory (./android)
✖ Failed to create the native directory
You may want to delete the ./ios and/or ./android directories before trying again.

I'm not sure what the cause is. If I use nvm and corepack instead of pkgx then I get further. But I don't have android studio installed on this machine, so that fails. Trying iOS next.

@chmac
Copy link
Member

chmac commented Jan 15, 2025

I get the following for iOS:

$ pkgx +pnpm +nodejs.org +cocoapods.org pnpm run ios

> [email protected] ios ~/tmp/trash/nr-mono/nr-app
> expo run:ios

✔ Installed CocoaPods
› Planning build

› 0 error(s), and 0 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 70.
To view more error logs, try building the app with Xcode directly, by opening ~/tmp/trash/nr-mono/nr-app/ios/nrapp.xcworkspace.

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ~/tmp/trash/nr-mono/nr-app/ios/nrapp.xcworkspace -configuration Debug -scheme nrapp -destination id=E1A34081-9C69-4C98-B35C-42D698D3072A

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES



2025-01-15 12:15:16.451 xcodebuild[6507:41060618] Writing error result bundle to /var/folders/h_/37qyvgn92xsb4bsdlh5phf1r0000gn/T/ResultBundle_2025-15-01_12-15-0016.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
		{ id:E1A34081-9C69-4C98-B35C-42D698D3072A }

	Ineligible destinations for the "nrapp" scheme:
		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 18.1 is not installed. To use with Xcode, first download and install the platform }
Build logs written to ~/tmp/trash/nr-mono/nr-app/.expo/xcodebuild.log
 ELIFECYCLE  Command failed with exit code 1.

@chmac
Copy link
Member

chmac commented Jan 15, 2025

The log file it mentions contains:

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ~/tmp/trash/nr-mono/nr-app/ios/nrapp.xcworkspace -configuration Debug -scheme nrapp -destination id=E1A34081-9C69-4C98-B35C-42D698D3072A

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

@chmac
Copy link
Member

chmac commented Jan 15, 2025

That's all I can manage today. Looks like it won't build for iOS. But why I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants