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

[Vue] Application died in status LOADING_SOURCE_CODE: Cannot read properties of undefined (reading 'meta') #356

Open
snifter opened this issue Apr 28, 2022 · 4 comments

Comments

@snifter
Copy link

snifter commented Apr 28, 2022

Vue application does not work. During activation in root-config followed exception is thrown.

Uncaught TypeError: application '@foo/bar' died in status LOADING_SOURCE_CODE: Cannot read properties of undefined (reading 'meta')
    at autoPublicPath (auto-public-path.jss:15:29)
    at Object../node_modules/systemjs-webpack-interop/auto-public-path/2.js (2.jss:3:1)
    at __webpack_require__ (bootstrapp:24:1)
    at startupp:7:1
    at Object.<anonymous> (startupp:8:1)
    at Object.execute (amd.js:56:35)
    at i (system-core.js:279:32)
    at e (system-core.js:275:10)
    at system-core.js:232:12

App is created with:

npx create-single-spa

? Directory for new project bar
? Select type to generate single-spa application / parcel
? Which framework do you want to use? vue
? Organization name (can use letters, numbers, dash or underscore) foo


Vue CLI v5.0.4
? Please pick a preset: Default ([Vue 3] babel, eslint)

Vue CLI v5.0.4
✨  Creating project in C:\test-vue\bar.
�  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...


added 849 packages in 18s

86 packages are looking for funding
  run `npm fund` for details
�  Invoking generators...
�  Installing additional dependencies...


added 97 packages in 4s

96 packages are looking for funding
  run `npm fund` for details
⚓  Running completion hooks...

�  Generating README.md...

�  Successfully created project test.


�  Installing vue-cli-plugin-single-spa...


added 4 packages in 2s

96 packages are looking for funding
  run `npm fund` for details
✔  Successfully installed plugin: vue-cli-plugin-single-spa


�  Invoking generator for vue-cli-plugin-single-spa...
�  Installing additional dependencies...


added 1 package in 2s

96 packages are looking for funding
  run `npm fund` for details
⚓  Running completion hooks...

✔  Successfully invoked generator for plugin: vue-cli-plugin-single-spa
Project setup complete!
Steps to test your Vue single-spa application:
1. Run 'npm run serve'
2. Go to http://single-spa-playground.org/playground/instant-test?name=@foo/test&url=%2F%2Flocalhost%3A8080%2Fjs%2Fapp.js&framework=vue to see it working!

The same is for Vue2.
For React everything works fine.

@filoxo filoxo closed this as completed Apr 28, 2022
@filoxo
Copy link
Contributor

filoxo commented Apr 28, 2022

My mistake, I was on the wrong tab in my browser and mistook this as the single-spa.js.org repo. Reopening.

@filoxo filoxo reopened this Apr 28, 2022
@jgavirias13
Copy link

I have similar error with Vue 2 TypeError: application '@foo/new-application' died in status LOADING_SOURCE_CODE: undefined is not an object (evaluating 'webpack_require.y.meta')

@jrtitus
Copy link

jrtitus commented Jul 1, 2022

I ran into this problem today also. I tried following the instructions for systemjs-interop, thinking that might have been the issue, but they did not help to resolve it. Then I tried with npx @4, @3 and @2 and all versions produce the same error, so I went looking at vue-cli-plugin-single-spa.

This comment seems to be the solution.

@krankos
Copy link

krankos commented Aug 8, 2022

I've run into this problem. I've found that it's a webpack problem. After some research I've managed to get it to work.
Your vue.config.js should look like this:

const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
    transpileDependencies: true,
    configureWebpack: {
        output: {
            libraryTarget: "system",
        },
    },
});

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

5 participants