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

v9: Prebuild doesn't complete with yarn2 #2518

Closed
flexbox opened this issue Oct 10, 2023 · 11 comments
Closed

v9: Prebuild doesn't complete with yarn2 #2518

flexbox opened this issue Oct 10, 2023 · 11 comments
Labels

Comments

@flexbox
Copy link
Collaborator

flexbox commented Oct 10, 2023

Describe the bug

Creating a new project crash.

Tested on the brand new macOS Sonoma with Xcode 15.0

npx ignite-cli@next new PizzaAppNext --verbose
Need to install the following packages:
  [email protected]
Ok to proceed? (y) y

✅ What bundle identifier? · com.pizzaappnext
✅ Where do you want to start your project? · /Users/cerebra/workspace/rn/PizzaAppNext
✅ Choose a workflow: · Expo Prebuild
✅ 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? · yarn
✅ Do you want to install dependencies? (Y/n) · Yes
✅ ❗EXPERIMENTAL❗Would you like to enable the New Architecture? (y/N) · No

image

    🖨  3D-printing a new React Native app
    🎨 Getting those last few details perfect
    🧶 Installing yarn dependencies (wow these are heavy)
    ⠇  Generating native template via Expo Prebuild
/Users/cerebra/.npm/_npx/2351a7c35afcf833/node_modules/gluegun/build/index.js:15
    throw up;
    ^
WARNING: The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo).
[12:46:52] Error reading Expo config at /Users/cerebra/workspace/rn/PizzaAppNext/app.config.ts:

⨯ Unable to compile TypeScript:
error TS6053: File 'expo/tsconfig.base' not found.


(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js v18.15.0

Hint I think gluegun needs to be updated to the last version to be node v18+ compatible?

infinitered/gluegun@0386d44

Ignite version

9.0.0-alpha.6

Additional info

image

❯ npx ignite-cli doctor
System
  platform           darwin
  arch               arm64
  cpu                8 cores      Apple M1
  directory          rn           /Users/cerebra/workspace/rn

/Users/cerebra/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:13
    throw up;
    ^
Usage Error: No project found in /Users/cerebra/workspace/rn

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...

(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js v18.15.0
@flexbox flexbox added the bug label Oct 10, 2023
@frankcalise
Copy link
Contributor

@jvm-cognition this is the type of error we want to catch gracefully with regards to the issue you are working on

@frankcalise
Copy link
Contributor

@flexbox it seems as if this died on prebuild - can you cd into the directory and run yarn prebuild:clean and see if there are any other error messages associated with it?

@flexbox
Copy link
Collaborator Author

flexbox commented Oct 10, 2023

image

it's weird I thought I removed globally expo-cli from my machine

⨯ Unable to compile TypeScript:
error TS6053: File 'expo/tsconfig.base' not found.


~/workspace/rn/PizzaAppNext
❯ where expo
/Users/cerebra/.nvm/versions/node/v18.15.0/bin/expo
/usr/local/bin/expo

~/workspace/rn/PizzaAppNext
❯ where expo-cli
/Users/cerebra/.nvm/versions/node/v18.15.0/bin/expo-cli
/usr/local/bin/expo-cli

~/workspace/rn/PizzaAppNext
❯ yarn --version
3.4.1

@flexbox
Copy link
Collaborator Author

flexbox commented Oct 10, 2023

So I ran

npm uninstall -g expo-cli

to un install legacy expo cli

~/workspace/rn/PizzaAppNext
❯ yarn prebuild:clean
Need to install the following packages:
  [email protected]
Ok to proceed? (y) y

still outputs an error 😅
image

It's recommended to back up your project before proceeding.

✔ Would you like to proceed? … yes

✔ Cleared android, ios code

CommandError: Error reading Expo config at /Users/cerebra/workspace/rn/PizzaAppNext/app.config.ts:

⨯ Unable to compile TypeScript:
error TS6053: File 'expo/tsconfig.base' not found.


@frankcalise
Copy link
Contributor

@flexbox can you check the results of:

npx expo init NewExpoApp
cd NewExpoApp
npx expo prebuild --clean

@flexbox
Copy link
Collaborator Author

flexbox commented Oct 11, 2023

expo init

is the legacy cli

from the docs
image

That's what I ran
image

~/workspace/rn
❯ npx expo init NewExpoApp

  $ expo init is not supported in the local CLI, please use npx create-expo-app instead


~/workspace/rn
❯ npx create-expo-app NewExpoApp
✔ Downloaded and extracted project files.
> npm install

and then

npx expo prebuild --clean

is working

image

The weird thing is: I checked on src/commands/new.ts and couldn't find where we use the expo cli 😭 to scaffold a new ignite app

@frankcalise
Copy link
Contributor

frankcalise commented Oct 14, 2023

Yeah it doesn't. We just call prebuild. Can you try clearing your npx cache?

Something like rm -rf ~/.npm/_npx

@frankcalise
Copy link
Contributor

The WARNING: The legacy expo-cli does not support Node +17. Migrate to the new local Expo CLI: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421. warning also comes out if you haven't installed dependencies at all.

@flexbox
Copy link
Collaborator Author

flexbox commented Oct 23, 2023

We are making progress 🚀

I ran

rm -rf ~/.npm/_npx

We should add an extra line here https://github.com/infinitered/ignite/blob/master/docs/Upgrading-Ignite.md

I tryed @9.0.0-alpha.7

npx ignite-cli@next new PizzaAppNextExpressoNoCache --verbose
Need to install the following packages:
  [email protected]
Ok to proceed? (y) y
image
    🧶 Installing yarn dependencies (wow these are heavy)
    ⠴  Generating native template via Expo Prebuild
/Users/cerebra/.npm/_npx/2351a7c35afcf833/node_modules/gluegun/build/index.js:15
    throw up;
    ^
npm WARN exec The following package was not found and will be installed: [email protected]
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
Git status is dirty but the command will continue because the terminal is not interactive.
CommandError: Error reading Expo config at /Users/cerebra/workspace/rn/PizzaAppNextExpressoNoCache/app.config.ts:

⨯ Unable to compile TypeScript:
error TS6053: File 'expo/tsconfig.base' not found.

Prebuild is still dying

image
❯ yarn prebuild:clean
We couldn't find a git repository in your project directory.
It's recommended to back up your project before proceeding.

✔ Would you like to proceed? … yes

✔ Cleared android, ios code

CommandError: Error reading Expo config at /Users/cerebra/workspace/rn/PizzaAppNextExpressoNoCache/app.config.ts:

⨯ Unable to compile TypeScript:
error TS6053: File 'expo/tsconfig.base' not found.

Solution to fix all of this

I was thinking, maybe the problem is related to the yarn 1.xx Vs yarn 2+ drama.

yarn set version 1.22.17
yarn
yarn prebuild:clean

Fixed everything 😬

image

Checklist to close this issue:

  • Add a section somewhere in the docs to clear npm cache rm -rf ~/.npm/_npx
  • Make sure we use yarn 1 during ignite-cli new

@frankcalise
Copy link
Contributor

Oh wow interesting, didn't consider yarn 2 with the doctor output failing. Will look into that thanks

@frankcalise frankcalise changed the title v9: The legacy expo-cli does not support Node +17. v9: Prebuild doesn't complete with yarn2/3 Oct 23, 2023
@frankcalise frankcalise changed the title v9: Prebuild doesn't complete with yarn2/3 v9: Prebuild doesn't complete with yarn2 Nov 29, 2023
@frankcalise
Copy link
Contributor

See this thread about Expo and yarn2, might be a workaround you can try, but going to close this as likely not an Ignite issue directly

expo/expo-cli#1073

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

No branches or pull requests

2 participants