Error coming after changing to webpack-hmr in Angular project.
See original GitHub issueI am sorry but I am not able to provide JSFiddle for it because I am facing problem in only webpack-angular environment.
I am facing this bug:
TypeError: Cannot read property 'diff' of undefined
at computeRangeAs (fullcalendar.js:587)
at Object.computeGreatestUnit (fullcalendar.js:557)
at Object.initScaleProps (scheduler.js:4354)
at ResourceTimelineView.TimelineView.renderDates (scheduler.js:667)
at ResourceTimelineView.DateComponent.executeDateRender (fullcalendar.js:8794)
at ResourceTimelineView.View.executeDateRender (fullcalendar.js:3686)
at Object.func (fullcalendar.js:3675)
at RenderQueue.runTask (fullcalendar.js:8671)
at RenderQueue.TaskQueue.runRemaining (fullcalendar.js:8563)
at RenderQueue.TaskQueue.tryStart (fullcalendar.js:8551)
Function which is throwing the error
My config of the fullCalendar:
{
schedulerLicenseKey: 'xxxx',
height: "auto",
theme: true,
themeButtonIcons: {
prev: 'circle-triangle-w',
next: 'circle-triangle-e',
prevYear: 'seek-prev',
nextYear: 'seek-next',
refresh: 'circle-triangle-w'
},
header: {
left: 'prev',
center: 'title',
right: 'next'
},
defaultDate: defaultDate,
defaultView: 'timeline' + this.calendarSettings.Settings.selectedDurationOption + 'ForTitan',
buttonText: {
today: 'today',
month: 'month',
week: 'week',
day: 'day',
list: 'list',
timeline3weeks: 'Schedule',
timelineTitanDefault: 'Timeline'
},
views: {
calendarDayForTitan: {
type: 'basicDay',
duration: { days: 1 }
},
calendarWeekForTitan: {
type: 'basicWeek',
duration: { days: 1 }
},
calendarMonthForTitan: {
type: 'month',
duration: { months: 1 }
},
calendarQuarterForTitan: {
type: 'month',
duration: { months: 3 }
},
timelineDayForTitan: {
type: 'timelineDay',
duration: { days: 1 },
},
timelineWeekForTitan: {
defaultDate: defaultDate,
type: 'timeline',
duration: { days: 7 },
slotDuration: { days: 1 }
},
timelineFortnightForTitan: {
defaultDate: defaultDate,
type: 'timeline',
dayCount: 14,
dateIncrement: { days: 7 },
},
timelineMonthForTitan: {
defaultDate: defaultDate,
type: 'timeline',
dayCount: 30,
dateIncrement: { days: 15 },
slotLabelFormat: ["MMMM", 'ddd D']
},
timelineQuarterForTitan: {
type: 'timelineMonth',
duration: { months: 3 },
slotDuration: { days: 1 }
},
timelineYearForTitan: {
type: 'timelineYear',
duration: { years: 1 },
slotDuration: { days: 1 }
},
timelineAgendaWeekForTitan:{
defaultDate: defaultDate,
type: 'agenda',
duration: { days: 7},
slotDuration: {minutes: 60},
slotEventOverlap: false,
slotLabelFormat: [""],
agendaTwoDay: {
type: 'agenda',
duration: { days: 1},
groupByResource: true
}
},
timelineAgendaFortForTitan:{
defaultDate: defaultDate,
type: 'agenda',
duration: { days: 14},
slotDuration: {minutes: 60},
slotEventOverlap: false,
slotLabelFormat: [""],
agendaTwoDay: {
type: 'agenda',
duration: { days: 1},
groupByResource: true
}
},
day: {},
week: {},
timeline3weeks: {
type: 'timeline',
duration: { months: 1 },
minTime: this.startWorkHoursValue,
maxTime: this.endWorkHoursValue,
slotDuration: this.defaultCalendarSetting.defaultViewSlotDuration,
},
listMonthForTitan: {
type: 'list',
duration: { months: 1 },
}
},
weekends: weekendValue,
editable: dragEditable,
disableDragging: self.calendarSettings.Settings.selectedDurationOption === 'AgendaFort' || self.calendarSettings.Settings.selectedDurationOption === 'AgendaWeek',
eventDurationEditable : false,
resourceAreaWidth: self.calendarSettings.Settings.resourceWidth+"px",
scrollTime: '00:00',
resourceGroupField: "entityTypeIdentifier",
filterResourcesWithEvents: resourceSetting,
It is weird that without any changes I am able to run it without webpack-hmr changes.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Hmr issues after update Angular - typescript
It says that module type cannot be found. The other answers I've found say delete all your nodule_modules and reinstall, add [nodes] to...
Read more >Enabling Hot Module Replacement (HMR) in Angular 6
Hot Module Replacement (HMR) is a key webpack feature that is not enable by default in Angular. It allows for modules to be...
Read more >Hot Module Replacement
Hot Module Replacement (or HMR) is one of the most useful features offered by webpack. It allows all kinds of modules to be...
Read more >The State of HMR in Angular
Hot Module Replacement speeds up development and debugging. It is a Webpack feature that updates changed modules without reloading the whole page. Angular...
Read more >Hot Module Replacement
Hot Module Replacement (HMR) is a WebPack feature to update code in a running app without rebuilding it. This results in faster updates...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I manually deleted moment from fullcalendar and scheduler, leaving it only in node_modules, and now it works. Just have to figure out how to get yarn to not install moment inside fullcalendar and scheduler automatically.
My issue is resolved. Was using both npm and yarn. Now using only yarn.