Comments (4)
Renan, now it works.
I just change the way to import the library. I used as the recommendation of the documentation.
`const imageToBase64 = require('image-to-base64');
The Wix show a mistake in the editor when import the library using "require". Actually there is no error, it works perfectly.
Thank you very much for the help!
from image-to-base64.
Hi dude, can you show me an example of your code?
Do you import correctly the library?
from image-to-base64.
Hi Renan,
Here is the code:
`import { imageToBase64 } from 'image-to-base64';
const url = 'https://static.wixstatic.com/media/1556ff_6196319be99f48be9def6d8685176a1c~mv2.png'
imageToBase64(url) // Path to the image
.then(
(response) => {
console.log(response); // "cGF0aC90by9maWxlLmpwZw=="
}
)
.catch(
(error) => {
console.log(error); // Logs an error if there was one
}
)
`
Is there some mistake?
from image-to-base64.
Hi Renan,
Here is the code:
`import { imageToBase64 } from 'image-to-base64';const url = 'https://static.wixstatic.com/media/1556ff_6196319be99f48be9def6d8685176a1c~mv2.png'
imageToBase64(url) // Path to the image
.then(
(response) => {
console.log(response); // "cGF0aC90by9maWxlLmpwZw=="
}
)
.catch(
(error) => {
console.log(error); // Logs an error if there was one
}
)`
Is there some mistake?
What is the version to use? WIX use react?
from image-to-base64.
Related Issues (20)
- Invalid base 64 string [Help Wanted] HOT 1
- one typo in README.md HOT 3
- is there way I can run it synchronously? HOT 5
- Error message not meaningful HOT 3
- Cors-Policy Error HOT 1
- Typescript support HOT 5
- how to solve ERR_UNESCAPED_CHARACTERS error? HOT 6
- Create a new release and publish on NPM HOT 1
- e.buffer is not a function HOT 9
- How to return the Base64 from object imageToBase64 HOT 1
- statSync issue due to too large image size HOT 9
- don't have time to take care of him, Can someone take care of it? HOT 3
- invalid regular expression in safari HOT 6
- CORS error when using imageToBase64 HOT 1
- Cannot find module 'fs' in 'image-to-base64' HOT 1
- Invalid regular expression: invalid group specifier name HOT 2
- Base64 image converter is not valid HOT 5
- CORS policy: No 'Access-Control-Allow-Origin' in react js HOT 1
- Blank Page in Safari : Create React APP project
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 image-to-base64.