Skip to content

Conversation

@c-ciobanu
Copy link
Contributor

@c-ciobanu c-ciobanu commented Jul 3, 2025

Example expo app working inside a cedar project.

simplescreenrecorder-2025-07-03_09.55.39.mp4

Some issues I found that should be looked into:

  • When using import { RedwoodApolloProvider } from '@cedarjs/web/apollo'
ERROR ReferenceError: Property 'RWJS_ENV' doesn't exist, js engine: hermes
WARN Route "./(tabs)/\_layout.tsx" is missing the required default export. Ensure a React component is exported as default.
ERROR ReferenceError: Property 'RWJS_ENV' doesn't exist, js engine: hermes
WARN Route "./(tabs)/index.tsx" is missing the required default export. Ensure a React component is exported as default.
ERROR ReferenceError: Property 'RWJS_ENV' doesn't exist, js engine: hermes
WARN Route "./\_layout.tsx" is missing the required default export. Ensure a React component is exported as default.
ERROR Warning: Invalid prop `style` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.

Fixed by passing graphQLClientConfig={{ uri: process.env.EXPO_PUBLIC_API_URL! }} to RedwoodApolloProvider

  • When using import { useQuery } from '@cedarjs/web'
 ERROR  Warning: Error: You must register a useQuery hook via the `GraphQLHooksProvider`

This error is located at:

  22 |
  23 | export default function HomeScreen() {
> 24 |   const { data, loading, error } = useQuery(QUERY)
     |                                            ^
  25 |

Fixed it by importing useQuery from @apollo/client

  • When using gql to define queries
 ERROR  ReferenceError: Property 'gql' doesn't exist, js engine: hermes

Fixed it by importing gql from @apollo/client

  • After a successful login often times the user credentials are not saved and you have to retry login multiple times until it succeeds

  • To get @cedarjs/auth-dbauth-web to work properly you have to define some global variables

globalThis.RWJS_ENV = {
  RWJS_API_GRAPHQL_URL: process.env.EXPO_PUBLIC_RWJS_API_GRAPHQL_URL!,
  RWJS_API_URL: process.env.EXPO_PUBLIC_API_URL!,
}
globalThis.RWJS_API_GRAPHQL_URL = process.env.EXPO_PUBLIC_RWJS_API_GRAPHQL_URL!
globalThis.RWJS_API_URL = process.env.EXPO_PUBLIC_API_URL!

@netlify
Copy link

netlify bot commented Jul 3, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 304bf7f
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/68663d2b73859800088a8771

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.

1 participant