From 4cc1addb3cdcd2254cac116026e12c48a754e201 Mon Sep 17 00:00:00 2001 From: Evandro Fonseca Junior Date: Mon, 14 Sep 2026 07:55:29 -0300 Subject: [PATCH] fix: make the web bundle run and repair broken route declarations - add babel.config.js with unstable_transformImportMeta: zustand/middleware ships import.meta.env, which the Metro web bundle (a classic script) cannot parse, so every page threw 'SyntaxError: Cannot use import.meta outside a module' and the app never hydrated after the static export. - declare the settings screen as 'settings/index' in the root stack: the old name 'settings' matched no route, so the modal presentation and the 'Settings' title were silently dropped (expo-router logged 'No route named settings exists'). - add the missing app/+not-found.tsx that the root layout already referenced. - update the About label from LocalAiApp to LocalMind. --- app/+not-found.tsx | 38 ++++++++++++++++++++++++++++++++++++++ app/_layout.tsx | 2 +- app/settings/index.tsx | 2 +- babel.config.js | 16 ++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 app/+not-found.tsx create mode 100644 babel.config.js diff --git a/app/+not-found.tsx b/app/+not-found.tsx new file mode 100644 index 0000000..69e9df2 --- /dev/null +++ b/app/+not-found.tsx @@ -0,0 +1,38 @@ +import { Link, Stack } from 'expo-router'; +import { StyleSheet, Text, View } from 'react-native'; + +export default function NotFoundScreen() { + return ( + <> + + + This screen does not exist. + + + Go to home screen + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + padding: 20, + }, + title: { + fontSize: 20, + fontWeight: 'bold', + }, + link: { + marginTop: 15, + paddingVertical: 15, + }, + linkText: { + fontSize: 14, + color: '#2e78b7', + }, +}); diff --git a/app/_layout.tsx b/app/_layout.tsx index d0fc518..a970afb 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -28,7 +28,7 @@ export default function RootLayout() { - + diff --git a/app/settings/index.tsx b/app/settings/index.tsx index 8ae4ead..3a9e692 100644 --- a/app/settings/index.tsx +++ b/app/settings/index.tsx @@ -215,7 +215,7 @@ export default function SettingsScreen() { - LocalAiApp - Cross Platform Version + LocalMind - Cross Platform Version diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..ee8566b --- /dev/null +++ b/babel.config.js @@ -0,0 +1,16 @@ +module.exports = function (api) { + api.cache(true); + return { + presets: [ + [ + 'babel-preset-expo', + { + // Dependencias (zustand/middleware) usam `import.meta.env`, que nao existe + // no bundle web do Metro (script classico) e quebrava a hidratacao do app. + // O polyfill do Expo troca por `globalThis.__ExpoImportMetaRegistry`. + unstable_transformImportMeta: true, + }, + ], + ], + }; +};