Repository navigation
ng build --prod causes Template Parse Error #1705
Description
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
- Clone the app and follow the instructions contained in the README.md.
- Run a Production build and deploy to staging server inside a directory called DTS.
- Access via http://localhost/dts
- 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"
- Mention any other details that might be useful.
Activity
kylecordes commentedon Aug 15, 2016
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 commentedon Aug 16, 2016
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 commentedon Aug 16, 2016
@kylecordes do you have the link to that issue? :)
kylecordes commentedon Aug 16, 2016
@yusijs angular/angular#10618
yusijs commentedon Aug 17, 2016
@kylecordes thanks! 👍
filipesilva commentedon Aug 23, 2016
Thanks @kylecordes for the spot on answer. Fixed by #1662 on the CLI.
robeverett commentedon Oct 19, 2018
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 commentedon Sep 8, 2019
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.