I recently upgraded our application using Uppy to version 3.20.0. I have one file that references Uppy but it is failing now and not sure how to fix it.
if (Uppy && !(this.uppy instanceof **Uppy**)) {
this.uppy = **Uppy**<'strict'>({
debug: false,
autoProceed: false,
allowMultipleUploads: false,
restrictions: {
maxFileSize,
maxNumberOfFiles,
minNumberOfFiles,
allowedFileTypes: null,
},
onBeforeFileAdded: this.onBeforeFileAddedCallback,
locale: {
strings: {
...(maxFileSizeMessage ? { exceedsSize: maxFileSizeMessage } : {}),
},
},
});
First error, on highlighted text, is “The right-hand side of an ‘instanceof’ expression must be of type ‘any’ or of a type assignable to the ‘Function’ interface type.ts(2359)” and second error is " Type ‘typeof import(“c:/ngen_screen_designer/node_modules/@uppy/core/types/index”)’ has no call signatures.ts(2349)"
Form &&
this.uppy?.use(**Form**, {
target: '.upload-file-form',
getMetaFromForm: true,
addResultToForm: true,
resultName: 'uppyResult',
submitOnSuccess: false,
});
Last common error is “Type ‘typeof import(“c:/ngen_screen_designer/node_modules/@uppy/form/types/index”)’ provides no match for the signature ‘new (uppy: Uppy<Record<string, unknown>, Record<string, unknown>>, opts?: PluginOptions | undefined): UIPlugin | BasePlugin<…>’.ts(2345)”
Hopefully an easy fix that someone can help me with. I’m new to NodeJS so seeking help on this.