admin管理员组文章数量:1391955
Try to use @originjs/vite-plugin-federation in tanstack-start application, but it throw an error while importing remote component like "Error in renderToPipeableStream: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'http:'". But if i do it using defineConfig from vite, everything works fine
This is my tanstack-start config
import { defineConfig } from '@tanstack/react-start/config';
import tsConfigPaths from 'vite-tsconfig-paths';
import federation from "@originjs/vite-plugin-federation";
export default defineConfig({
vite: {
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
federation({
name: "host-app",
remotes: {
todo_components: "http://localhost:4173/assets/remoteEntry.js",
},
shared: ["react"],
}),
],
build: {
modulePreload: true,
target: "ES2022",
minify: false,
cssCodeSplit: false,
},
},
});
本文标签: viteTanstackstart module federation import errorStack Overflow
版权声明:本文标题:vite - Tanstack-start module federation import error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744733291a2622173.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论