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
{{ message }}
Repository navigation
Facing issue in img upload when using uploadthing v4.x.x ++(using 7.3.0) #277
I'm not extremely knowledgeable on EditorJS nor Typescript itself, but I managed to make it work.
Sure, my use case is completely different than yours, since I have no reason to save the images on a S3 bucket nor database and that's because I will serve them in my /public folder itself. So in other words, I just need to render what is already being served in the public folder. The use case might not make sense for you, but it does for me.
Using node version:
node -v
v23.6.1
Here is the relevant content from my package.json file.
Activity
jsperafico commentedon Jan 28, 2025
Hey @20200015-anhh ,
I'm not extremely knowledgeable on EditorJS nor Typescript itself, but I managed to make it work.
Using node version:
Here is the relevant content from my
package.jsonfile.{ "type": "module", "scripts": { "dev": "vite", }, "dependencies": { "@editorjs/editorjs": "^2.30.7", "@editorjs/image": "^2.10.1", "react": "^18.3.1", "react-dom": "^18.3.1" }, "devDependencies": { "@types/node": "^22.9.1", "@types/react": "^18.3.12", "@vitejs/plugin-react": "^4.3.3", "typescript": "~5.6.2", "vite": "^5.4.10" } }My
component.tsxlooks like this:So, while "updating" the image, it did saved the information correctly:
{ "time": 1738082234704, "blocks": [ { "id": "q1PHuyT-IM", "type": "header", "data": { "text": "Hey this might work this time!", "level": 1 } }, { "id": "5pkBzMiNWw", "type": "image", "data": { "caption": "Dammmmmmmm", "withBorder": false, "withBackground": false, "stretched": false, "file": { "url": "/hey.svg" } } } ], "version": "2.30.7" }I am well aware that this isn't necessarily what you would like to do, but speaking stricktly
@editorjs/imagecomponent-wise it did worked for me.I hope it helps!