2025-06-12 - frontend page template error

From Izara Wiki
Revision as of 10:55, 12 June 2025 by Rut (talk | contribs) (Created page with "==Error== <syntaxhighlight> Cannot use import statement outside a module SyntaxError: Cannot use import statement outside a module application '@izaraFrontends/payment' died in status LOADING_SOURCE_CODE: Cannot use import statement outside a module SyntaxError: Cannot use import statement outside a module </syntaxhighlight> ==fix== <syntaxhighlight lang="JavaScript"> const { merge } = require("webpack-merge"); const singleSpaDefaults = require("webpack-config-single-...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Error

Cannot use import statement outside a module
SyntaxError: Cannot use import statement outside a module

application '@izaraFrontends/payment' died in status LOADING_SOURCE_CODE: Cannot use import statement outside a module
SyntaxError: Cannot use import statement outside a module

fix

const { merge } = require("webpack-merge");
const singleSpaDefaults = require("webpack-config-single-spa-react");

module.exports = (webpackConfigEnv, argv) => {
  const defaultConfig = singleSpaDefaults({
    orgName: "izaraFrontends",// need change to your project organization name
    projectName: "payment", // need change to your project name
    webpackConfigEnv,
    argv,
    outputSystemJS: true, // add code edit error
  });

  return merge(defaultConfig, {
    // modify the webpack config however you'd like to by adding to this object
  });
};