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

Unable to start expo app when not using app.json file #26467

Closed
1 of 4 tasks
richmondp opened this issue Jun 8, 2024 · 2 comments · Fixed by #26713
Closed
1 of 4 tasks

Unable to start expo app when not using app.json file #26467

richmondp opened this issue Jun 8, 2024 · 2 comments · Fixed by #26713
Assignees
Labels
scope: react-native Issues relating to React Native type: bug

Comments

@richmondp
Copy link

richmondp commented Jun 8, 2024

Current Behavior

I have 2 basic expo applications, one that uses an app.json file and the other uses app.config.ts, which according to Expo documentation should both be valid config file names.

When I run nx run with-json-config:start the application starts correctly, but when I run nx run with-ts-config:start I get the error message Cannot find configuration for task with-ts-config:start.

Further to this, if I run nx show project with-json-config --web I see the following list of targets

image

However, when I run nx show project with-ts-config --web I only see the following targets

image

I'm not sure how these targets get generated (they are not in the project.json file) but it looks as though they only get generated when an app.json file is present.

If I add a custom start target like below, and I run nx run with-ts-config:custom-start, then the application starts as expected.

{
  "name": "with-ts-config",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/with-ts-config/src",
  "projectType": "application",
  "tags": [],
  "// targets": "to see all targets run: nx show project with-ts-config --web",
  "targets": {
    "custom-start": {
      "executor": "@nx/expo:start",
      "options": {
        "port": 8081
      }
    }
  }
}

Note: Both applications (with-json-config and with-ts-config) were created using nx g @nx/expo:application <app name>

Expected Behavior

I would expect that I should be able to start applications that use app.json and app.config.ts in the same way without having to write any extra code/configurations

GitHub Repo

https://github.com/richmondp/nx-expo-test

Steps to Reproduce

  1. clone repo and run npm install
  2. run nx run with-json-config:start - works
  3. run nx run with-ts-config:start - fails
  4. run nx run with-ts-config:custom-start - works

Nx Report

Node   : 20.12.1
OS     : darwin-arm64
npm    : 10.5.0

nx (global)        : 19.2.0
nx                 : 19.2.2
@nx/js             : 19.2.2
@nx/jest           : 19.2.2
@nx/linter         : 19.2.2
@nx/eslint         : 19.2.2
@nx/workspace      : 19.2.2
@nx/detox          : 19.2.2
@nx/devkit         : 19.2.2
@nx/eslint-plugin  : 19.2.2
@nx/expo           : 19.2.2
@nx/playwright     : 19.2.2
@nx/react          : 19.2.2
@nrwl/tao          : 19.2.2
@nx/web            : 19.2.2
@nx/webpack        : 19.2.2
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/expo/plugin
@nx/eslint/plugin
@nx/jest/plugin
@nx/detox/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I'm not sure if this issue is related to #25291 - it looks similar but this one is related to migration.

@guillempuche
Copy link

#26285 is closed.

@richmondp check if it works.

@richmondp
Copy link
Author

@guillempuche

I've had a read through that issue and bumped my nx version to 19.2.3 and modified my package.json but I am still getting the same issue. Is there something I am missing? I didn't quite understand the connection between these two issues.

New NX Report

Node   : 20.12.1
OS     : darwin-arm64
npm    : 10.5.0

nx (global)        : 19.2.0
nx                 : 19.2.3
@nx/js             : 19.2.3
@nx/jest           : 19.2.3
@nx/linter         : 19.2.3
@nx/eslint         : 19.2.3
@nx/workspace      : 19.2.3
@nx/detox          : 19.2.3
@nx/devkit         : 19.2.3
@nx/eslint-plugin  : 19.2.3
@nx/expo           : 19.2.3
@nx/playwright     : 19.2.3
@nx/react          : 19.2.3
@nrwl/tao          : 19.2.3
@nx/web            : 19.2.3
@nx/webpack        : 19.2.3
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/expo/plugin
@nx/eslint/plugin
@nx/jest/plugin
@nx/detox/plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants