English 中文(简体)
React Vite 模块联合会远程 Entry.js “ TypeError: 获取动态导入模块失败 ”
原标题:React Vite Module Federation remoteEntry.js "TypeError: Failed to fetch dynamically imported module"
  • 时间:2024-07-25 16:52:05
  •  标签:
  • reactjs
  • vite
主机可访问远程应用程序的远程 Entry.js 文件。 远程配置 / https://vitejs. dev/config/ 导出默认定义Config ({插件): [反应( ), Federal( 名称: 远程_ app), 文件名: 远程 Entry.js, 曝光: { { 共享: [反应( 反应), 反应( 反应), 反应( 反应), 反应( 反应), 反应( ) 反应( 反应), 反应( 反应) 反应( ), 反应( 反应( ) 反应( 反应) 反应( 反应), 反应( 反应( 名称): 5001/assets/ reteetrotry.js.
最佳回答
Getting remoteEntry.js access The issue is here is that npm run dev is the wrong command to use when running locally. To fix this, make sure you are running npm run preview on the remote app Accessing Modules Another issue you might run into if you are using TypeScript is loading the module. Make sure you put all modules you are declaring in a file called tsremote.d.ts the .d.ts is mandatory for this to pick up the remote modules. Then inside the tsremote.d.ts file you can declare what you want to access declare module remoteApp/App ;
问题回答

暂无回答




相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签