Git Product home page Git Product logo

Comments (7)

me-12 avatar me-12 commented on May 18, 2024

The Angular CLI does not compile the App as UMD module. And therefore system.js in the portal app can't load it.

You need a custom webpack.config.js which defines all the necessary steps to compile the Angular app with singleSpaEntry.js as entry file to a UMD module.

Take a look in the folder "app5Angular" which is an Angular 6 app that works.

from single-spa-portal-example.

adrianlemess avatar adrianlemess commented on May 18, 2024

So, if we have a team working with a project generate with angular-cli, we need to eject the build to do with webpack? it's posible to mantain both configurations (angular-cli and webpack.config) in the same project?

from single-spa-portal-example.

kgamalseif avatar kgamalseif commented on May 18, 2024

Also, I am getting the same issue...
Uncaught Error: Application 'app6' died in status LOADING_SOURCE_CODE: Unable to dynamically transpile ES module A loader plugin needs to be configured via SystemJS.config({ transpiler: 'transpiler-module' }). Instantiating http://localhost:9000/app6/singleSpaEntry.js Loading /app6/singleSpaEntry.js

Is there any way to load angular 6 cli app with singleSpaEntry.js?
appreciate your help...

from single-spa-portal-example.

fireappsAdmin avatar fireappsAdmin commented on May 18, 2024

Did you find a way around this? I am also having this issue.

from single-spa-portal-example.

maciej-w avatar maciej-w commented on May 18, 2024

@fireappsAdmin @kgamalseif
This question has already an answer, you need to eject your apps (if possible) and then create a custom webpack.config -> Take a look in the folder "app5Angular" which is an Angular 6 app that works. Or have a look below.

@adrianlemess
I created an Angular 6 app (which doesn't have the ng eject option anymore and used "@angular-builders/custom-webpack": "^2.5.4", then in my angular.json you have to update the build options like this:
"build": { "builder": "@angular-devkit/build-angular:browser",

You'll find more info at the package website. Anyways if you place just the webpack.config.js in your root folder and add the npm run watch:portal from the example Angular apps it'll work and serve the app to the portal.

from single-spa-portal-example.

kgamalseif avatar kgamalseif commented on May 18, 2024

@maciej-w
Thanks for reply, I also used the app5Angular as a guide, and unfortunately got the same error.

I am able to browse my app after npm run watch:portal as below, but got the LOADING_SOURCE_CODE error when browsing using portal.

image

Appreciate your help...

from single-spa-portal-example.

maciej-w avatar maciej-w commented on May 18, 2024

@kgamalseif - I can see that this is a different app than form the example. To me it looks like your module is not building correctly, without looking at the code I'm not able to help. Please follow this to check if your code follows best practices: Angular AOT

from single-spa-portal-example.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.