Custom widget error messages TS2769: No overload matches this call
0
Hi there, hope you could help with this. I am trying with Mendix Studio Pro 8.6.3 to create as per “https://gettingstarted.mendixcloud.com/link/module/328/lecture/2938/11.7.2-Passing-Data-to-Your-Component---TypeScript-version” section 11.7.2 but when I tried to build the widget with “npm run build” I got below error messages: $ npm run build > shiftcalendar@1.0.0 build C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar > pluggable-widgets-tools build:web Running MX Widgets Tools script build:web... [23:59:44] Using gulpfile ~\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\node_modules\@mendix\pluggable-widgets-tools\scripts\gulp.js [23:59:44] Starting 'build'... [23:59:44] Starting 'clean'... [23:59:44] Finished 'clean' after 15 ms [23:59:44] Starting 'generateTypings'... [23:59:44] Finished 'generateTypings' after 42 ms [23:59:44] Starting 'bound runWebpack'... Webpack output: Hash: 462bb8d761a31ed62bbf9d993bcf93a6185e9912 Version: webpack 4.43.0 Child Hash: 462bb8d761a31ed62bbf Time: 6006ms Built at: 07/28/2020 11:59:51 PM Asset Size Chunks Chunk Names widgets/ShiftCalendar.xml 2.88 KiB [emitted] widgets/mendix/shiftcalendar/ShiftCalendar.js 32.2 KiB main [emitted] main widgets/mendix/shiftcalendar/ShiftCalendar.js.map 32.9 KiB main [emitted] [dev] main widgets/package.xml 405 bytes [emitted] Entrypoint main = widgets/mendix/shiftcalendar/ShiftCalendar.js widgets/mendix/shiftcalendar/ShiftCalendar.js.map ERROR in ./src/ShiftCalendar.tsx Module build failed (from ./node_modules/ts-loader/index.js): Error: TypeScript emitted no output for C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\ShiftCalendar.tsx. at makeSourceMapAndFinish (C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\node_modules\ts-loader\dist\index.js:80:15) at successLoader (C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\node_modules\ts-loader\dist\index.js:68:9) at Object.loader (C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\node_modules\ts-loader\dist\index.js:22:12) ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\ShiftCalendar.tsx ./src/ShiftCalendar.tsx [tsl] ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\ShiftCalendar.tsx(9,17) TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<CalendarProps>): CalendarContainer', gave the following error. Property 'culture' is missing in type '{ shifts: CalendarEvent[]; }' but required in type 'Readonly<CalendarProps>'. Overload 2 of 2, '(props: CalendarProps, context?: any): CalendarContainer', gave the following error. Property 'culture' is missing in type '{ shifts: CalendarEvent[]; }' but required in type 'Readonly<CalendarProps>'. ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\components\CalendarContainer.tsx [tsl] ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\components\CalendarContainer.tsx(32,21) TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<CalendarProps<CalendarEvent, object>>): Calendar<CalendarEvent, object>', gave the following error. Type 'string[]' is not assignable to type 'View[] | { work_week?: boolean | (ComponentClass<any, any> & ViewStatic) | (FunctionComponent<any> & ViewStatic) | undefined; day?: boolean | ... 2 more ... | undefined; agenda?: boolean | ... 2 more ... | undefined; month?: boolean | ... 2 more ... | undefined; week?: boolean | ... 2 more ... | undefined; } | undef...'. Type 'string[]' is not assignable to type 'View[]'. Type 'string' is not assignable to type 'View'. Overload 2 of 2, '(props: CalendarProps<CalendarEvent, object>, context?: any): Calendar<CalendarEvent, object>', gave the following error. Type 'string[]' is not assignable to type 'View[] | { work_week?: boolean | (ComponentClass<any, any> & ViewStatic) | (FunctionComponent<any> & ViewStatic) | undefined; day?: boolean | ... 2 more ... | undefined; agenda?: boolean | ... 2 more ... | undefined; month?: boolean | ... 2 more ... | undefined; week?: boolean | ... 2 more ... | undefined; } | undef...'. Type 'string[]' is not assignable to type 'View[]'. Child Hash: 9d993bcf93a6185e9912 Time: 6114ms Built at: 07/28/2020 11:59:51 PM Asset Size Chunks Chunk Names widgets/ShiftCalendar.editorPreview.js 20.9 KiB main [emitted] main Entrypoint main = widgets/ShiftCalendar.editorPreview.js ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\ShiftCalendar.tsx [tsl] ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\ShiftCalendar.tsx(9,17) TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<CalendarProps>): CalendarContainer', gave the following error. Property 'culture' is missing in type '{ shifts: CalendarEvent[]; }' but required in type 'Readonly<CalendarProps>'. Overload 2 of 2, '(props: CalendarProps, context?: any): CalendarContainer', gave the following error. Property 'culture' is missing in type '{ shifts: CalendarEvent[]; }' but required in type 'Readonly<CalendarProps>'. ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\components\CalendarContainer.tsx [tsl] ERROR in C:\Users\Adriana\Documents\Mendix\Summerhill Hospital-main\CustomWidgets\shiftCalendar\src\components\CalendarContainer.tsx(32,21) TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly<CalendarProps<CalendarEvent, object>>): Calendar<CalendarEvent, object>', gave the following error. Type 'string[]' is not assignable to type 'View[] | { work_week?: boolean | (ComponentClass<any, any> & ViewStatic) | (FunctionComponent<any> & ViewStatic) | undefined; day?: boolean | ... 2 more ... | undefined; agenda?: boolean | ... 2 more ... | undefined; month?: boolean | ... 2 more ... | undefined; week?: boolean | ... 2 more ... | undefined; } | undef...'. Type 'string[]' is not assignable to type 'View[]'. Type 'string' is not assignable to type 'View'. Overload 2 of 2, '(props: CalendarProps<CalendarEvent, object>, context?: any): Calendar<CalendarEvent, object>', gave the following error. Type 'string[]' is not assignable to type 'View[] | { work_week?: boolean | (ComponentClass<any, any> & ViewStatic) | (FunctionComponent<any> & ViewStatic) | undefined; day?: boolean | ... 2 more ... | undefined; agenda?: boolean | ... 2 more ... | undefined; month?: boolean | ... 2 more ... | undefined; week?: boolean | ... 2 more ... | undefined; } | undef...'. Type 'string[]' is not assignable to type 'View[]'. [23:59:51] Finished 'bound runWebpack' after 6.7 s [23:59:51] Starting 'createMpkFile'... [23:59:51] Finished 'createMpkFile' after 39 ms [23:59:51] Starting 'copyToDeployment'... Files generated in dist and ..\..\ folder [23:59:51] Finished 'copyToDeployment' after 20 ms [23:59:51] Finished 'build' after 6.82 s Many thanks Adri