vite - Tanstack-start module federation import error - Stack Overflow

Try to use @originjsvite-plugin-federation in tanstack-start application, but it throw an error while

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,
    },
  },
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744733293a4590591.html

相关推荐

  • vite - Tanstack-start module federation import error - Stack Overflow

    Try to use @originjsvite-plugin-federation in tanstack-start application, but it throw an error while

    15小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信