You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @johndatserakis ,
I am getting this error Uncaught TypeError: file_upload_with_preview__WEBPACK_IMPORTED_MODULE_4__.FileUploadWithPreview is not a constructor in ReactJs v18.2.0
"file-upload-with-preview": "^5.0.8",
Here is my sample code
import "file-upload-with-preview/dist/file-upload-with-preview.min.css";
import { FileUploadWithPreview } from "file-upload-with-preview";
import React, { useState } from "react";
function Gallery() {
if (typeof window !== "undefined") {
const upload = new FileUploadWithPreview("file-upload", {
multiple: true,
});
}
return (
<div
class="custom-file-container"
data-upload-id="file-upload"
></div>
);
}
The text was updated successfully, but these errors were encountered:
Hey there, sorry for the issue and the delay responding. I will look into this ASAP.
I'm not sure what is causing your issue - but here's a link to a working TypeScript codepen that imports file-upload-with-preview the general way, and it is working correctly. Maybe something can jump out at us.
Hey there - sorry for the trouble. I just went through and updated the package.json's exports property to be aligned with the modern expectations. To get the latest export type, use v6.0.2. You should no longer have to import from 'file-upload-with-preview/dist/file-upload-with-preview.esm'.
Hello @johndatserakis ,
I am getting this error
Uncaught TypeError: file_upload_with_preview__WEBPACK_IMPORTED_MODULE_4__.FileUploadWithPreview is not a constructor
in ReactJsv18.2.0
"file-upload-with-preview": "^5.0.8",
Here is my sample code
The text was updated successfully, but these errors were encountered: