webpack5 Uncaught TypeError: application 'xxx' died in status LOADING_SOURCE_CODE: Cannot read properties of undefined (reading 'meta') at autoPublicPath
after upgrade vue webpack5... error occurred.
(set libraryTarget = umd) https://github.com/single-spa/vue-cli-plugin-single-spa/blob/main/index.js#L26
npm run serve:standalone
invoked SystemJSPublicPathWebpackPlugin (https://github.com/single-spa/vue-cli-plugin-single-spa/blob/main/index.js#L33)
inner invoked
https://github.com/joeldenning/systemjs-webpack-interop/blob/main/auto-public-path/auto-public-path.js#L15
此处 __system_context__ 是 undefined,报错

Currently, I change vue.config.js, fllow:
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
chainWebpack: config => {
config.output.libraryTarget("system")
},
})
reproducing repo: https://github.com/Jarryxin/vue-spa-app
@Jarryxin I was dealing with the same error after upgrading to v5 of the Vue CLI. Since it apparently uses Webpack 5, I don't think the SystemJSPublicPathWebpackPlugin is needed.
The following seemed to solve the error for me:
// vue.config.js
module.exports = {
configureWebpack: {
output: {
libraryTarget: "system",
},
},
chainWebpack: (config) => {
if (config.plugins.has("SystemJSPublicPathWebpackPlugin")) {
config.plugins.delete("SystemJSPublicPathWebpackPlugin");
}
},
filenameHashing: false,
};
@Jarryxin I was dealing with the same error after upgrading to v5 of the Vue CLI. Since it apparently uses Webpack 5, I don't think the SystemJSPublicPathWebpackPlugin is needed.
The following seemed to solve the error for me:
// vue.config.js module.exports = { configureWebpack: { output: { libraryTarget: "system", }, }, chainWebpack: (config) => { if (config.plugins.has("SystemJSPublicPathWebpackPlugin")) { config.plugins.delete("SystemJSPublicPathWebpackPlugin"); } }, filenameHashing: false, };
thank you!!! delete SystemJSPublicPathWebpackPlugin, it works. love you!!