After npm update: Can't convert undefined to object
Hi,
After updating all npm packages I get the following error on startup of the scheduler:
error: TypeError: "can't convert undefined to object"
node_modules syncfusion/ej2-schedule/src/schedule/base/schedule.js:451
node_modules syncfusion/ej2-schedule/src/schedule/renderer/view-base.js:16
node_modules syncfusion/ej2-schedule/src/schedule/renderer/vertical-view.js:318
node_modules syncfusion/ej2-schedule/src/schedule/renderer/vertical-view.js:503
node_modules syncfusion/ej2-schedule/src/schedule/renderer/vertical-view.js:471
node_modules syncfusion/ej2-schedule/src/schedule/renderer/vertical-view.js:387
node_modules syncfusion/ej2-schedule/src/schedule/renderer/vertical-view.js:376
node_modules syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:115
node_modules syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:25
node_modules syncfusion/ej2-schedule/src/schedule/base/schedule.js:426
node_modules syncfusion/ej2-schedule/src/schedule/base/schedule.js:275
node_modules syncfusion/ej2-schedule/src/schedule/base/resource.js:505
node_modules syncfusion/ej2-schedule/src/schedule/base/resource.js:482
node_modules syncfusion/ej2-schedule/src/schedule/base/resource.js:469
I deleted all the node_modules syncfusion directories and cldr-data directory. And installed it again (and npm dedupe), but no change.
I load the cldr like this:
import { L10n, loadCldr, setCulture, Browser } from '@syncfusion/ej2-base'
import { DataManager, UrlAdaptor, Query } from '@syncfusion/ej2-data'
import { Day, Week, Month, Agenda, Resize, DragAndDrop } from '@syncfusion/ej2-vue-schedule'
import * as localeTexts from '../../../lang/ejs-schedule.json'
import * as numberingSystems from 'cldr-data/supplemental/numberingSystems.json'
import * as gregorian from 'cldr-data/main/nl/ca-gregorian.json'
import * as numbers from 'cldr-data/main/nl/numbers.json'
import * as timeZoneNames from 'cldr-data/main/nl/timeZoneNames.json'
// Set locale
L10n.load(localeTexts);
loadCldr(numberingSystems, gregorian, numbers, timeZoneNames);
setCulture('nl')
Package.json
"@syncfusion/ej2-vue-calendars": "^17.3.27",
"@syncfusion/ej2-vue-schedule": "^17.3.27",
"cldr-data": "^36.0.0",
When I remove the load cldr lines and set the locale to 'en' the scheduler works. Any idea how to fix?
SIGN IN To post a reply.
13 Replies
BS
Balasubramanian Sattanathan
Syncfusion Team
November 14, 2019 04:03 PM UTC
Hi Arwin,
Greetings from Syncfusion Support.
We have checked your reported scenario and prepared sample based on your requirement. Kindly try below sample and let us know if you need further assistance on this.
Sample : https://www.syncfusion.com/downloads/support/forum/149065/ze/schedule_vue_locale-1762776194.zip
Regards,
Balasubramanian S
AR
Arwin
December 5, 2019 05:00 PM UTC
Hmm, the example gives the error:
TypeError: "longDateFormat is undefined"
node_modules view-base.js:344
node_modules view-base.js:318
node_modules renderer.js:112
node_modules renderer.js:25
node_modules schedule.js:426
node_modules schedule.js:275
node_modules schedule.js:254
node_modules schedule.js:143
node_modules component.js:145
node_modules component-base.js:48
What should I do?
BS
Balasubramanian Sattanathan
Syncfusion Team
December 6, 2019 12:48 PM UTC
Hi Arwin,
Thanks for the update.
We have tried to reproduce your problem in below sample with reported version. But we couldn’t get any problem in sample and it is working properly at our end. So We have made a video demo for your reference.
Sample : https://www.syncfusion.com/downloads/support/forum/149065/ze/schedule_vue_locale712709247.zip
Video demo : https://www.syncfusion.com/downloads/support/forum/149065/ze/vue_schedule_locale1232054941.zip
Kindly refer the above links and If you still facing any errors at your end kindly share the workable sample/issue replication steps to serve you better.
Regards,
Balasubramanian S
AR
Arwin
December 9, 2019 10:07 PM UTC
Thank you for the example. But I try too integrate it in my application but it will not work. I keep getting the error: TypeError: "longDateFormat is undefined".
I have investegate the file view-base.js line 344 where the error is comming from and I noticed that the first parameter is of the getValue of that line is:
"main.nl.dates.calendars.gregorian.dateFormats.long"
"main.nl.dates.calendars.gregorian.dateFormats.long"
and the second parameter is an object with language data (cldrData). It not starting with 'main', but with 'default' (see screenshot).
If I change the line to "default.main.nl.dates.calendars.gregorian.dateFormats.long" the error is gone (but the next getValue('main....) gives an error).
Any idea how to fix? I have tried to create an example that is not working, but not succeeded.
Attachment: Schermafbeelding_20191209_om_23.05.04.png_35036309.zip
BS
Balasubramanian Sattanathan
Syncfusion Team
December 10, 2019 09:22 AM UTC
Hi Arwin,
Thanks for the update.
We suspect that you are using improper json file for localization conversion. So kindly use cldr-data json file to avoid the reported issue like our previously shared sample. If we have misunderstood, kindly try to reproduce the reported issue in our previously shared sample/share the more details for your problem with issue replication steps/code snippet/video demo(if possible) for serve you better.
Regards,
Balasubramanian S
AR
Arwin
December 10, 2019 02:41 PM UTC
Hi syncfusion,
I installed "cldr-data": "^36.0.0", back again. And pointed all the json files to the correct items, but same the still error. I don't know where to look now.
I have added a link to a video of the problem. Hopefully you can see what there is wrong.
I take the following steps in the video:
1. Show files Calendar2.vue, locale.json, package.json
2. Delete node_modules directories @syncfusion and cldr-data
3. Run npm install
4. Run npm run dev
5. Show errors
6. Add debug lines in view-base.js
7. Show debug information.
Attachment: videourl.txt_9671cf2e.zip
VD
Vinitha Devi Murugan
Syncfusion Team
December 11, 2019 11:09 AM UTC
Hi Arwin,
We have created a new support incident under your account, please follow the incident for further assistance. Kindly log on to our support website to check further updates on it
Regards,
M.Vinitha devi
AR
Arwin
June 25, 2020 01:25 PM UTC
Hi Syncfusion,
I updated laravel-mix from v2.1.1 to v4.1.4 (it compiles the vue application with webpack). The new version uses [email protected] but now the scheduler is not working anymore (see image in attachment). I created an example with the error.
Npm version: 6.11.3
Node version: 10.17.0
ERROR when I open the calendar (no error when compiling):
message: "longDateFormat is undefined"
stack: "ViewBase.prototype.formatDateRange@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/view-base.js:362:26\nViewBase.prototype.getDateRangeText@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/view-base.js:328:21\nRender.prototype.updateHeader@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:124:77\nRender.prototype.initializeLayout@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:104:14\nRender.prototype.render@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:25:14\nSchedule.prototype.initializeView@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/schedule.js:519:27\nSchedule.prototype.renderElements@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/schedule.js:338:14\nResourceBase.prototype.refreshLayout@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/resource.js:543:21\nResourceBase.prototype.dataManagerSuccess@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/resource.js:520:14\nResourceBase.prototype.bindResourcesData/<@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/resource.js:507:64\n"
Attachment: webpackerror_8e7520b1.zip
I updated laravel-mix from v2.1.1 to v4.1.4 (it compiles the vue application with webpack). The new version uses [email protected] but now the scheduler is not working anymore (see image in attachment). I created an example with the error.
Npm version: 6.11.3
Node version: 10.17.0
ERROR when I open the calendar (no error when compiling):
message: "longDateFormat is undefined"
stack: "ViewBase.prototype.formatDateRange@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/view-base.js:362:26\nViewBase.prototype.getDateRangeText@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/view-base.js:328:21\nRender.prototype.updateHeader@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:124:77\nRender.prototype.initializeLayout@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:104:14\nRender.prototype.render@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/renderer/renderer.js:25:14\nSchedule.prototype.initializeView@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/schedule.js:519:27\nSchedule.prototype.renderElements@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/schedule.js:338:14\nResourceBase.prototype.refreshLayout@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/resource.js:543:21\nResourceBase.prototype.dataManagerSuccess@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/resource.js:520:14\nResourceBase.prototype.bindResourcesData/<@webpack-internal:///./node_modules/@syncfusion/ej2-schedule/src/schedule/base/resource.js:507:64\n"
Attachment: webpackerror_8e7520b1.zip
BS
Balasubramanian Sattanathan
Syncfusion Team
July 1, 2020 10:17 AM UTC
Hi Arwin,
Thanks for your patience.
We have validated your reported scenario “The new version uses [email protected] but now the scheduler is not working anymore” at our side and we have tried to run the shared project. But we are unable to run it. So could you please the share the below details to serve you better?
- Share the steps to run the project
- Share issue replication steps
Our machine configuration :
NPM version: 6.11.3
Node version: 10.17.0
Kindly let us know if you need further assistance.
Regards,
Balasubramanian S
AR
Arwin
July 1, 2020 12:52 PM UTC
Hi,
Thank you for the response.
Hopefully you saw the README.md file, in there you found the installation instructions (just run npm install and npm run dev).
See also the attached video (I updated to node v14.4.0 before I made the video and same errors as with node v10.17.0).
Hopefully you can find the problem.
Attachment: CleanShot_20200701_at_14.42.51.mp4_ae992b47.zip
PG
Pon Geetha A J
Syncfusion Team
July 3, 2020 09:56 AM UTC
Hi Arwin,
Thanks for the update.
We have created a new support incident under your account and will update further details in it. Please follow the incident for further assistance.
Kindly log on to our support website to check further updates on it
Regards,
Balasubramanian S
AR
Arwin
July 14, 2020 02:08 PM UTC
For people that have the same issue, this was the solution:
Do:
|
loadCldr(numberingSystems["default"], gregorian["default"], numbers["default"], timeZoneNames["default"]); |
Don’t:
|
loadCldr(numberingSystems, gregorian, numbers, timeZoneNames); |
VM
Vengatesh Maniraj
Syncfusion Team
July 15, 2020 05:05 AM UTC
Hi Arwin,
Thanks for the update.
Yes. That was the solution.
Please get in touch with us if you need any further assistance.
Regards,
Vengatesh
SIGN IN To post a reply.
- 13 Replies
- 5 Participants
-
AR Arwin
- Nov 13, 2019 09:14 AM UTC
- Jul 15, 2020 05:05 AM UTC