Primeng: Schedule not working on Angular 6 prod mode

Created on 14 May 2018  路  4Comments  路  Source: primefaces/primeng

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
In Angular 6 production mode (after running ng build --prod) and using Lazy Loading routes, the schedule is not rendering, but in development mode (ng serve) it's working as expected. This happens only on Angular 6, on 5.2 was working fine.

Expected behavior
The schedule should render and call the onViewRender event.

Minimal reproduction of the problem with instructions
Create a component Schedule.component with the cli and only put the <p-schedule></p-schedule> inside it's HTML. Then, lazy load it in the AppModule for example and run the ng build --prod script. After it, serve the distribution file and see it behavior.

Please tell us about your environment:

macOS 10.13.4
VSCode 1.23.1
npm 5.6.0

  • Angular version: 6.0.0

  • PrimeNG version: 5.2.6

  • Browser: all

  • Language: TypeScript 2.7.2

  • Node (for AoT issues): node --version = 9.11.1

Most helpful comment

I've fixed this problem by NOT using the min version of moment.js and fullcalendar.js.
New scripts section in .angular-cli.json or angular.json depending on CLI version:
"scripts": [
"../node_modules/jquery/dist/_jquery.slim.js_",
"../node_modules/moment/_moment.js_",
"../node_modules/chart.js/dist/Chart.js",
"../node_modules/fullcalendar/dist/_fullcalendar.js_"
],

As opposed to the old one:
"scripts": [
"../node_modules/jquery/dist/_jquery.js_",
"../node_modules/moment/min/_moment.min.js_",
"../node_modules/chart.js/dist/Chart.js",
"../node_modules/fullcalendar/dist/_fullcalendar.min.js_"
],

Hope this helps.

All 4 comments

Some problem here. I've reported it here too: https://github.com/primefaces/primeng/issues/5717

I've fixed this problem by NOT using the min version of moment.js and fullcalendar.js.
New scripts section in .angular-cli.json or angular.json depending on CLI version:
"scripts": [
"../node_modules/jquery/dist/_jquery.slim.js_",
"../node_modules/moment/_moment.js_",
"../node_modules/chart.js/dist/Chart.js",
"../node_modules/fullcalendar/dist/_fullcalendar.js_"
],

As opposed to the old one:
"scripts": [
"../node_modules/jquery/dist/_jquery.js_",
"../node_modules/moment/min/_moment.min.js_",
"../node_modules/chart.js/dist/Chart.js",
"../node_modules/fullcalendar/dist/_fullcalendar.min.js_"
],

Hope this helps.

Thanks for the response @hle09, your solution is working fine as using min versions still doesn't work... @cagataycivici

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gatapia picture gatapia  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

pchristou picture pchristou  路  3Comments

markgoho picture markgoho  路  3Comments