infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!
MIT License
17.59k stars 1.39k forks source link

Ignite X web crashes #2807

Open lindboe opened 6 days ago

lindboe commented 6 days ago

Describe the bug

Generate a new project and run it on web.

ReferenceError: setImmediate is not defined
KeyboardAwareScrollView<@http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:165874:9
ScreenWithScrolling@http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:139643:9
div
View<@http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:34588:21
KeyboardAvoidingView@http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:54929:7
div
Screenshot 2024-10-16 at 10 36 00 AM

It looks like the addition of KeyboardAwareScrollView isn't compatible with web, and we need to fall back to regular ScrollView where it's used.

We should probably also have a smoke test for web to make sure it's able to load without errors, but if it's our first web test that might be more scope when we just want this fixed, we can break that out into another task.

Ignite version

10.0.0

Additional info

System
  platform           darwin
  arch               arm64
  cpu                10 cores     Apple M1 Max
  directory          TextCheck    /Users/lizzi/dev/igniteTests/TextCheck

JavaScript (and globally-installed packages)
  node                22.6.0                                    /opt/homebrew/bin/node
  npm                 10.8.2                                    /opt/homebrew/bin/npm
    expo-cli          6.0.8
    npm               10.8.2
    yarn              1.22.17
  yarn                1.22.17                                   /opt/homebrew/bin/yarn
    create-expo-app   3.0.0
    create-vite       4.1.0
  pnpm                9.4.0                                     /opt/homebrew/bin/pnpm
                      <no pnpm global package info available>
  bun                 1.1.21                                    /opt/homebrew/bin/bun
  expo                51.0.37                                   managed
  expo global cli     6.0.8                                     Deprecated: Found 'expo-cli' installed. Please remove it.

Ignite
  ignite-cli         10.0.0       /Users/lizzi/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite
  ignite src         build        /Users/lizzi/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build

Android
  java               17.0.11      /Users/lizzi/.jenv/shims/java
  android home       -            /Users/lizzi/Library/Android/sdk

iOS
  xcode              16.0
  cocoapods          1.13.0       /Users/lizzi/.rbenv/shims/pod

Tools
  git                git version 2.46.0   /opt/homebrew/bin/git
frankcalise commented 6 days ago

That's interesting because it looks like web was stubbed out a bit ago: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/208

frankcalise commented 6 days ago

Also interesting: https://github.com/necolas/react-native-web/issues/1891#issuecomment-887502705

frankcalise commented 6 days ago

An open issue at react-navigation about the useLayoutEffect + setOptions: https://github.com/react-navigation/react-navigation/issues/11748

shtefanilie commented 1 day ago

Getting the same thing over here!