GithubHelp home page GithubHelp logo

Comments (20)

JustinCouto avatar JustinCouto commented on August 17, 2024 4

I can assure you we are still putting energy into Playground. Our entire company is built on top of using it. Now that ng12 is final, we will be updating it to work on this version. We are also always open to contributions.

from angular-playground.

JustinCouto avatar JustinCouto commented on August 17, 2024 4

@jornare @JerryDoubleU Angular Playground has been updated for Angular 12. Just run ng-update

from angular-playground.

rekoch avatar rekoch commented on August 17, 2024 3

I am not sure if this helps to find the cause of the issue. I played a lot round to find when it does happen.

  1. create an application with your CLI
  2. integrate angular playground as usual with "ng add angular-playground"
  3. create at least 1 playground app to test a component
  4. try to start playground -> it will usually work as thought
  5. delete node-modules
  6. reinstall packages with npm install
  7. start angular playground -> it fails with this error message about all the dependencies missing. it will show an error for each sandbox component
  8. go to your angular.json "playground" config to the "sourceRoot" entry
  9. point the entry to a path, where no sandbox files exists
  10. restart angular playground
  11. it will show playground main page with no components
  12. revert the config change in "sourceRoot" back to "src"
  13. restart playground -> it will work again

So somehow it needs first an empty playground page before it can show the sandbox components. i also watched, that while the dependencies error exists, it does not bundle the chunk files. If I read about the ivy compiler
https://angular.io/guide/ivy#ivy-and-universalapp-shell
it looks that maybe there is the reason.

n version 9, the server builder which is used for App shell and Angular Universal has the bundleDependencies option enabled by default. If you opt-out of bundling dependencies you will need to run the standalone Angular compatibility compiler (ngcc). This is needed because otherwise Node will be unable to resolve the Ivy version of the packages

So the easiest way to fix it is to change your tsconfig.playground.json file and add there this lines:

  "angularCompilerOptions": {
    "enableIvy": false
  }

it will no longer use the ivy compiler and it looks like it fixes it. so maybe there is also one tiny config in the playground, where the bundling does not work the right way.

from angular-playground.

lurock avatar lurock commented on August 17, 2024 2

Try putting a postinstall in your package.json with ngcc as the command. In the scripts section of the package.json add "postinstall": "ngcc"

Then delete your node modules and run npm install

from angular-playground.

jrdutton avatar jrdutton commented on August 17, 2024 1

Sorry, that did not solve it for me

from angular-playground.

JustinCouto avatar JustinCouto commented on August 17, 2024 1

from angular-playground.

lslocum avatar lslocum commented on August 17, 2024 1

@rekoch This absolutely fixed my problem! Thank you so much for researching this!
bitmoji

from angular-playground.

JustinCouto avatar JustinCouto commented on August 17, 2024 1

Hey There,

From our understanding, the ngcc will be removed from Angular as soon as libraries support IVY. At that time, this will no longer be an issue. If turning off IVY for playground works better for you, thats great. Thanks rekock for contributing to the conversion.

from angular-playground.

jornare avatar jornare commented on August 17, 2024 1

Now on ng12, how are we doing here?

from angular-playground.

jornare avatar jornare commented on August 17, 2024 1

Great to hear @JustinCouto . It's been my favorite so far, especially since it's native Angular.

from angular-playground.

jrdutton avatar jrdutton commented on August 17, 2024

Yep, seeing this too

from angular-playground.

jornare avatar jornare commented on August 17, 2024

I solved this on my machine by removing the node_modules folder and reinstall npm i

from angular-playground.

DanWahlin avatar DanWahlin commented on August 17, 2024

I'm seeing the same error (thanks for mentioning it to me @jrdutton). Cleared node_modules and even package-lock.json to start from scratch but still get the error. Example repo here if interested:

https://github.com/DanWahlin/Angular-JumpStart

from angular-playground.

DanWahlin avatar DanWahlin commented on August 17, 2024

Awesome - that fixed it @lurock. Thanks!

from angular-playground.

lslocum avatar lslocum commented on August 17, 2024

According to this post we should not be setting this post install script. Is there another answer? angular/angular#38003 (comment)

from angular-playground.

lurock avatar lurock commented on August 17, 2024

Currently this solves the issue for running the Angular Playground. We do not have another fix at this time. We are willing to accept pull requests if you have a solution to this issue.

from angular-playground.

lslocum avatar lslocum commented on August 17, 2024

It is disappointing to hear the solution is something the Angular team says not to do expect in this 1 special use case.

from angular-playground.

JustinCouto avatar JustinCouto commented on August 17, 2024

HI @Islocum

It is disappointing to hear the solution is something the Angular team says not to do expect in this 1 special use case.

As we mentioned we would love to take a pull request from you if you would like to dig in and find an answer to this issue. Angular Playground is an open-source tool we built and use heavily at SoCreate. We provide it to the Angular Community as we hope to help other developers be as productive as possible. We don't make money on the tool. With that being said, we commit a substantial amount of resources to continually improve it and keep it up-to-date releasing it in step with new versions of Angular since Angular 2. We plan to continue to do that. As for minor things like this or other features that people want or need, we hope to make this a community effort. If we all work together, this tool can become more amazing over time. We look forward to receiving your commit. Thank you for your interest and passion for Angular and Angular Playground.

from angular-playground.

JerryDoubleU avatar JerryDoubleU commented on August 17, 2024

Now on ng12, how are we doing here?

Haha, not well. Ivy is forced now :)
I had no success running angular-playground on ng12.
I'm still looking for some solution, I'll post something if I manage to run it.

from angular-playground.

jornare avatar jornare commented on August 17, 2024

Cool, it crashed hard on me to. It hasn't been much activity here lately so maybe it's time to move over to Storyboard since that's what's embraced by nx.

from angular-playground.

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.