Comments (14)
Alright I figured out a solution
- First thing go here and copy the whole file
https://github.com/onurzorluer/react-image-file-resizer/blob/3a0fab44211f985aaf048b4fa71027b7149da90e/src/index.js
- Make a file called
Resizer.js
in your src directory in react. - Paste the code you copied in this file
- Whenever you want to use this function
import Resizer from "relative path to Resizer.js";
- Remove
import Resizer from "react-image-file-resizer";
wherever it is used
from react-image-file-resizer.
This is not really helpful. I don't want to locally fork the module
My workaround is to do
import Resizer from "react-image-file-resizer";
// @ts-expect-error https://github.com/onurzorluer/react-image-file-resizer/issues/68
const resizer: typeof Resizer = (Resizer.default || Resizer);
from react-image-file-resizer.
Related issue reported to vitejs vitejs/vite#4935, looks like the commonjs2 build target is not compatible with the default vite config.
from react-image-file-resizer.
Was anyone able to use this library with vite somehow? dying to know..
from react-image-file-resizer.
I got the same error , someone fixed this?
from react-image-file-resizer.
Same problem. Vite 3.0
from react-image-file-resizer.
same issue
from react-image-file-resizer.
Same issue
from react-image-file-resizer.
same issue
from react-image-file-resizer.
any updates on this?
from react-image-file-resizer.
same issue
from react-image-file-resizer.
same issue
typeError: buildExports.imageFileResizer is not a function
at onChange
from react-image-file-resizer.
Alright I figured out a solution
- First thing go here and copy the whole file
https://github.com/onurzorluer/react-image-file-resizer/blob/3a0fab44211f985aaf048b4fa71027b7149da90e/src/index.js
- Make a file called
Resizer.js
in your src directory in react.- Paste the code you copied in this file
- Whenever you want to use this function
import Resizer from "relative path to Resizer.js";
- Remove
import Resizer from "react-image-file-resizer";
wherever it is used
it works , thanks for your help
from react-image-file-resizer.
Alright I figured out a solution
- First thing go here and copy the whole file
https://github.com/onurzorluer/react-image-file-resizer/blob/3a0fab44211f985aaf048b4fa71027b7149da90e/src/index.js
- Make a file called
Resizer.js
in your src directory in react.- Paste the code you copied in this file
- Whenever you want to use this function
import Resizer from "relative path to Resizer.js";
- Remove
import Resizer from "react-image-file-resizer";
wherever it is used
It worked.. thanks :)
from react-image-file-resizer.
Related Issues (20)
- PNG transparency is lost even when using compressFormat PNG HOT 3
- Force resize HOT 1
- why is the rotation is not "set"
- No response (success nor error) with HEIC format. HOT 9
- imageFileResizer is not a function after build HOT 11
- We need a fixed aspact ratio attribute.
- Why a class?
- FileReader': parameter 1 is not of type 'Blob'. HOT 7
- react version 17.0.2 HOT 1
- Indeterminate result HOT 3
- Support for GIF and Animated WebP HOT 2
- Is there anything underway to port this to Vuejs3 (or does it exist elsewhere)? HOT 1
- Image is getting pixeled after resizing it HOT 1
- Quality not affecting PNG format HOT 1
- add support for array or similar for outputType
- keep metadata
- Can't find variable: FileReader
- Resize algorithm
- File extensions concatenated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-image-file-resizer.