Skip to content

ng build --prod causes Template Parse Error #1705

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
jt-helsinki opened this issue Aug 15, 2016 · 8 comments
Closed

ng build --prod causes Template Parse Error #1705

jt-helsinki opened this issue Aug 15, 2016 · 8 comments

Comments

@jt-helsinki
Copy link

I am new to angular and I have built a small application that needs to display a sortable table. It all runs fine in Angular-cli development server in development mode (using ng serve).

I've tried implementing the table with both the <ng2-table> and <angular-table> libraries so I suspect this is not a problem associated with either one of these libraries.

However when I build the application using ng build --prod for deployment onto my staging server I receive the following error inside the browser console when I try to access the application

zone.js:461 Unhandled Promise rejection: Template parse errors:
Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. ("                     <td colspan="3">
                                        <mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]"></mfBootstrapPaginator>
                                    </td>
     "): a@42:62 ; Zone: <root> ; Task: Promise.then ; Value:

Template parse errors:↵Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. ("                     <td colspan="3">↵                                        <mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]"></mfBootstrapPaginator>↵                                    </td>↵     "): a@42:62"

It seems that the bundling is not including the <ng2-table> and <angular-table> libraries within the build. This is either my SNAFU or a pro

I've updated my code so that it is all running using Angular 2.0.0RC5. That is, so that it uses the new @NgModule decorator.

Any help or advice you can offer would be much appreciated. I'm at an end here.

Many thanks

JT

Note: I tried temporarily specifiying the DataTableDirectives as a directive under the component's @component decorator but this didn't help.


1. OS
Mac OSX El Capitan?

2. Versions.
Angular RC5
angular-cli: 1.0.0-beta.10
node: 6.3.1

3. Repro steps.

The app was originally created using the CLI tool.

Full code is available here: https://github.com/paistipoikka/GH_DTS

  1. Clone the app and follow the instructions contained in the README.md.
  2. Run a Production build and deploy to staging server inside a directory called DTS.
  3. Access via http://localhost/dts
  4. Check browser console for error message.

4. The log given by the failure.

zone.js:461 Unhandled Promise rejection: Template parse errors:
Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. ("
<mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]">

"): a@42:62 ; Zone: ; Task: Promise.then ; Value:

Template parse errors:↵Can't bind to 'rowsOnPageSet' since it isn't a known property of 'mfBootstrapPaginator'. (" ↵ <mfBootstrapPaginator [ERROR ->][rowsOnPageSet]="[10,25,100]">↵ ↵ "): a@42:62"

  1. Mention any other details that might be useful.
@kylecordes
Copy link

This is a problem that first appeared in the angular/angular issue tracker a few hours after RC5 came out. There is a workaround already in master of both angular and angular-cli. If you use the current master angular-cli (use npm link, see README "Development Hints") it will work for you already, you don't have to wait for the next CLI version to be published.

@jt-helsinki
Copy link
Author

Many thanks Kyle. that's great. I'm glad to know it's an existing problem. I'll have a read and try to get this fixed.

Thanks again

JT

@yusijs
Copy link

yusijs commented Aug 16, 2016

@kylecordes do you have the link to that issue? :)

@kylecordes
Copy link

@yusijs
Copy link

yusijs commented Aug 17, 2016

@kylecordes thanks! 👍

@filipesilva
Copy link
Contributor

Thanks @kylecordes for the spot on answer. Fixed by #1662 on the CLI.

@robeverett
Copy link

If you only get these error in --prod mode, but not in dev, what are the implications, if any, in deploying an angular six application to a production server ?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants