Skip to content

Angular cli beta.31+ breaks playground #11

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

Closed
isaacplmann opened this issue Feb 22, 2017 · 9 comments
Closed

Angular cli beta.31+ breaks playground #11

isaacplmann opened this issue Feb 22, 2017 · 9 comments

Comments

@isaacplmann
Copy link
Contributor

With @angular/[email protected] or @angular/[email protected], when you run angular-playground angular-playground.json, you get the following error message:

[ng serve]: Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the p
lugins options.

Running npm start works just fine.

I reproduced by taking your example-app-angular-cli, updating the @angular/cli version and running npm i && npm run playground.

Thanks.

@jschwarty
Copy link
Contributor

Hi @isaacplmann! We have a note in the Changelog about this issue. Once Angular CLI goes to RC0 they should have the support for multiple apps added and we will update the docs to show how to do that for Playground. This will eliminate the error. But for the time being you will need to stay on 1.0.0-beta.30 or make use of the webpack eject feature. I'd recommend waiting for RC0 though as the webpack eject would just be a temporary fix and one that is not needed once we get multi-app support in Angular CLI.

@isaacplmann
Copy link
Contributor Author

Thanks for letting me know. It would probably be good to mention this issue in the documentation somewhere too. Or you could just leave this issue open until RC0 drops.

@jschwarty
Copy link
Contributor

I was debating on adding it to the docs site but I think this fix is really close to being available (it has been merged into AngularCLI master already). Hopefully that will be on npm soon and I can update the docs to have the instructions on how to use it with the latest version :)

@isaacplmann
Copy link
Contributor Author

I'm excited to use angular cli rc.0, but the error still occurs with the latest version. I'm assuming I need to define a separate app with an entry point that references PlaygroundModule instead of AppModule. I'll work in that direction and let you know if I make any progress.

@isaacplmann
Copy link
Contributor Author

I got it working and then found your angular-cli-rc.0 branch on github. I'm doing the same thing, except I had to add <ap-root></ap-root> in the index.html (or reference a custom index.playground.html with <ap-root>). Are you able to make it work without that step? Or are you handling it in a different way?

@jschwarty
Copy link
Contributor

jschwarty commented Feb 27, 2017

I just merged that into master and am working on pushing a release out to npm. Here is a link to the example app for angular cli in the code base that shows how to setup the app in the .angular-cli.json file:

https://github.com/SoCreate/angular-playground/blob/master/example-app-angular-cli/.angular-cli.json

I will be updating the docs after that to explain the new approach.

@isaacplmann
Copy link
Contributor Author

I needed to add <ap-root> to index.html because I wasn't calling initializeSandbox('ng-app') in the main.playground.ts file. Looks good in your demo app, now I just need to get it to work in my real app.

@jschwarty
Copy link
Contributor

@isaacplmann
Copy link
Contributor Author

Working for me. Closing.

lurock pushed a commit that referenced this issue Jan 4, 2018
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

2 participants