Using snack expo dev v48, Failed to resolve dependency '@react-navigation/native@*'

package.json
Failed to resolve dependency ‘@react-navigation/native@*’ (Module build failed (from …/…/…/…/…/…/…/node_modules/babel-loader/lib/index.js):
Retry
SyntaxError: /tmp/snackager/snackager/buildStatus/1/@react-navigation~native@6.1.7-ios,android,web/package/node_modules/@react-navigation/core/src/types.tsx: Unexpected token, expected “?” (705:52)

703 | [RouteName in keyof ParamList]?: NonNullable<
704 | ParamList[RouteName]

705 | > extends NavigatorScreenParams<infer T extends {}>
| ^
706 | ? string | PathConfig
707 | : string | Omit<PathConfig<{}>, ‘screens’ | ‘initialRouteName’>;

package.json (11:5)
Failed to resolve dependency ‘@react-navigation/native@*’ (Network request failed)

Anyone to help ?
How can I clear the cache on snack editor ?

Hi @adouwedji, this seems like an issue in snack. Please feel free to report an issue with a minimal reproducible example in this repo: GitHub - expo/snack: Expo Snack lets you run Expo in the browser.

I was able to get it working but I needed to delete my node modules and start adding dependencies one by one after updating the imports in my app.js to start using the new packages. Hope that helps!

1 Like