Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack5 Uncaught TypeError: application 'xxx' died in status LOADING_SOURCE_CODE: Cannot read properties of undefined (reading 'meta') at autoPublicPath #46

Open
Jarryxin opened this issue May 23, 2022 · 3 comments

Comments

@Jarryxin
Copy link

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,报错

image

Currently, I change vue.config.js, fllow:

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  chainWebpack: config => {
    config.output.libraryTarget("system")
  },
})
@Jarryxin
Copy link
Author

Jarryxin commented May 23, 2022

reproducing repo: https://github.com/Jarryxin/vue-spa-app

@rrjohnson85
Copy link

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

@Roned
Copy link

Roned commented May 18, 2023

@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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants