Add Metro config for monorepo module resolution
Metro couldn't resolve hoisted packages (@maplibre, @gorhom, etc.) because it only looked in apps/mobile/node_modules. Configure watchFolders and nodeModulesPaths to include the monorepo root. Also revert MapLibre fallback — direct import is correct, the issue was Metro resolution, not a missing native module. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
58bff065ff
commit
2a94af5655
2 changed files with 19 additions and 10 deletions
|
|
@ -1,18 +1,9 @@
|
|||
import { useRef, useCallback } from "react";
|
||||
import { StyleSheet, View, Text } from "react-native";
|
||||
import MapLibreGL from "@maplibre/maplibre-react-native";
|
||||
import type { Waypoint } from "@trails-cool/types";
|
||||
import type { RouteSegment } from "./use-route-editor";
|
||||
|
||||
import type MapLibreRN from "@maplibre/maplibre-react-native";
|
||||
|
||||
let MapLibreGL: typeof MapLibreRN | null = null;
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
MapLibreGL = require("@maplibre/maplibre-react-native").default;
|
||||
} catch {
|
||||
// Native module not available — will show fallback UI
|
||||
}
|
||||
|
||||
const OSM_STYLE = {
|
||||
version: 8 as const,
|
||||
sources: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue