Skip to content

ng build --prod causes Template Parse Error #1705

Closed

Description

@jt-helsinki

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.

Activity

  1. kylecordes commented on Aug 15, 2016

    @kylecordes

    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.

  2. jt-helsinki commented on Aug 16, 2016

    @jt-helsinki
    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

  3. yusijs commented on Aug 16, 2016

    @yusijs

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

  4. kylecordes commented on Aug 16, 2016

    @kylecordes
  5. yusijs commented on Aug 17, 2016

    @yusijs

    @kylecordes thanks! 👍

  6. filipesilva commented on Aug 23, 2016

    @filipesilva
    Contributor

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

  7. robeverett commented on Oct 19, 2018

    @robeverett

    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 ?

  8. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions