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

Can't get app to compile in a new Angular + Webpacker Application #2180

Closed
mayordwells opened this issue Jul 15, 2019 · 6 comments
Closed

Can't get app to compile in a new Angular + Webpacker Application #2180

mayordwells opened this issue Jul 15, 2019 · 6 comments
Assignees

Comments

@mayordwells
Copy link

I have created a new Rails app and tried to add Angular to it but it fails to compile. I have tried different options from the documentation but I am getting the same error.

Screen Shot 2019-07-15 at 9 38 24 AM

I have followed a few instructions from this issue - #2031

and followed the documentation from here - https://github.com/rails/webpacker/blob/master/docs/es6.md and here https://github.com/rails/webpacker#angular-with-typescript

But these did not fix anything. Installing Angular with Webpacker and starting the app is supposed to work by default, but it looks like the source of the problem is the new implementation of core-js. Any idea how to fix this?

I have pushed a demo app on github to demo this problem please take a look here - https://github.com/mayordwells/angular-webpacker-app

@CyHunterX
Copy link

Well i have the same issue in the installation of angular with webpack in rails. I make a research for more than a month and i don't found nothing about it. So is a bug, or a line of code, i need to add some gem or add some plug in with yarn? i want to know how to set up this and work with angular and rails.

here i have a output
Screenshot from 2019-07-14 13-48-28

@ayazhussein
Copy link

ayazhussein commented Aug 20, 2019

@mayordwells @CyHunterX
if you are using core-js@3, you have to import "core-js/es/reflect" instead of import "core-js/es6/reflect" and also import "core-js/proposals/reflect-metadata" instead of import "core-js/es7/reflect" or you can downgrade to core-js@2

@ibrahimab
Copy link
Contributor

ibrahimab commented Sep 13, 2019

I have confirmed that @ayazhussein's suggestion works. For the people who want to know where to do this: app/javascript/your-angular-app/polyfills.ts

What I want to know is, why was rails 6 released with this major problem? @dhh
I would love to help solve this problem, if nobody is working on this. I am assuming not, because nobody is assigned to this issue, but would love confirmation from the core team.

@jakeNiemiec
Copy link
Member

I would love to help solve this problem, if nobody is working on this.

Sure, a PR would be more than welcome! Here is the last time that file was changed: #736

why was rails 6 released with this major problem?

I personally don't use angular anymore, so I rely on the community to send in PRs since these 3rd party libraries change often.

@ibrahimab
Copy link
Contributor

ibrahimab commented Sep 14, 2019

I have created a simple pull request, see #2286

I will also work on updating the example application to the new ways of using angular (e.g. support of templateUrl instead of just template).

@guillaumebriday
Copy link
Member

I think it's not relevant anymore, feel free to reopen if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants