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

Problem starting angular app #517

Open
mgg709 opened this issue May 13, 2024 · 4 comments
Open

Problem starting angular app #517

mgg709 opened this issue May 13, 2024 · 4 comments

Comments

@mgg709
Copy link

mgg709 commented May 13, 2024

Demonstration

Expected Behavior

When I run the command npm run serve:single-spa:menu I want my app to start working but I get the following errors

Actual Behavior

When I run the command npm run serve:single-spa:menu I get the following errors:

`./src/main.single-spa.ts:4:0-45 - Error: Module not found: Error: Can't resolve './app/app.module' in 'C:\Repositorios\micro-frontends\menu\src'

./src/main.single-spa.ts:5:0-57 - Error: Module not found: Error: Can't resolve './environments/environment' in 'C:\Repositorios\micro-frontends\menu\src'

Error: src/main.single-spa.ts:7:27 - error TS2307: Cannot find module './app/app.module' or its corresponding type declarations.

7 import { AppModule } from './app/app.module';
~~~~~~~~~~~~~~~~~~

Error: src/main.single-spa.ts:8:29 - error TS2307: Cannot find module './environments/environment' or its corresponding type declarations.

8 import { environment } from './environments/environment';
`

My main.single-spa.ts:

`

import { enableProdMode, NgZone } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { singleSpaAngular } from 'single-spa-angular';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { singleSpaPropsSubject } from './single-spa/single-spa-props';

if (environment.production) {
enableProdMode();
}

const lifecycles = singleSpaAngular({
bootstrapFunction: singleSpaProps => {
singleSpaPropsSubject.next(singleSpaProps);
return platformBrowserDynamic().bootstrapModule(AppModule);
},
template: '',
NgZone,
});

export const bootstrap = lifecycles.bootstrap;
export const mount = lifecycles.mount;
export const unmount = lifecycles.unmount;
`

I'm using the single-spa framework and I have simply created an angular app following the steps that come out of the terminal

@mgg709
Copy link
Author

mgg709 commented May 13, 2024

Also I have another question, How can I specify the version of Angular when installing it using the default steps through the terminal?

@claudiomerli
Copy link

Seems schematics actually doesn't support Angular 18

@anwarminst
Copy link

same issue I'm facing. any help will be appreciate

@dipsx
Copy link

dipsx commented Sep 10, 2024

Seems schematics actually doesn't support Angular 18

it's angular 17 - I have the same error

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

4 participants