我正在try 部署一个使用EXPO和EXPO-ROUTER构建的Reaction原生网络应用程序到Vercel.这一过程的一部分涉及到使用webpackBundle 代码.到目前为止,我一直在使用Metro进行开发,它运行得很好.
我无法得到的项目建设使用webpack.我认为问题出在我的根级index.js文件和路由的Groups功能中.
expo 路由的文件上说有
import "expo-router/entry";
在文件的顶部.
如果我这样做,我会得到以下错误:
Module not found: Can't resolve '..\..\app'
10 | typeof window === "undefined" ? React.Fragment : Head.Provider;
11 |
> 12 | const ctx = require.context(process.env.EXPO_ROUTER_APP_ROOT);
| ^
13 |
14 | // Must be exported or Fast Refresh won't update the context
15 | export function App() {
这troubleshooting page个文档使我相信我应该用以下内容替换我的index.js文件的内容:
import { registerRootComponent } from "expo";
import { ExpoRoot } from "expo-router";
export function App() {
const ctx = require.context("./app");
return <ExpoRoot context={ctx} />;
}
registerRootComponent(App);
在这样做之后,我收到了几个错误
Multiple files match the route name...
This happens even with the most basic of setups.个
谢谢