Uncaught TypeError: application '@app/hello-world' died in status LOADING_SOURCE_CODE: _types_single_spa_react__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function


webpack.config.js

const { merge } = require("webpack-merge");
const Dotenv = require("dotenv-webpack");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const path = require("path");
const singleSpaDefaults = require("webpack-config-single-spa-react-ts");

module.exports = (webpackConfigEnv, argv) => {
  const defaultConfig = singleSpaDefaults({
    orgName: "app",
    projectName: "hello-world",
    webpackConfigEnv,
    argv,
  });

  return merge(defaultConfig, {
    resolve: {
      extensions: [".ts", ".d.ts", ".tsx", ".js"],
      preferRelative: true,
      plugins: [new TsconfigPathsPlugin()],
    },
    devServer: {
      port: 8500,
    },
    plugins: [
      new Dotenv({
        path: "./.env.development",
      }),
    ],
    output: {
      path: path.resolve(__dirname, 'build'),
    },
  });
};

app-hello-world.tsx file

import React from 'react';
import * as ReactDOMClient from "react-dom/client";
import "./types/single-spa-react";
import singleSpaReact from "./types/single-spa-react";
import Parcel from "./types/parcel";
import { App } from './root.component';

const lifecycles = singleSpaReact({
  React,
  ReactDOMClient,
  rootComponent: App,
  errorBoundary(err, info, props) {
    // Customize the root error boundary for your microfrontend here.
    return null;
  },
});

    enter code here

React.createElement(Parcel, {
  config: lifecycles,
});

Thanck Uncaught TypeError: application '@app/hello-world' died in status LOADING_SOURCE_CODE: _types_single_spa_react__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function

0

There are 0 best solutions below