-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Tool: uploading failed because of incorrect response - Nuxt #40
Comments
The problem is that editor sends request to the current url instead of localhost:2020 as specified in the config. |
Thanks for looking. Any chance this could be a problem with nuxt config / proxies?
|
For some reason, the config object is not being set on editor.js. |
I have the same problem, but I have fresh vue.js project(not nuxt), created via vue-cli, I can't overwrite config object. |
I didn't solve this problem and eventually opted for another editor. |
Isn't there a solution? |
I am having this exact same issues. It seems this plugin never use the config for image tool. |
Hi i've the same issue and the solution is to use custom uploader right here editor.js custom uploader here's example of mine import Image from '@editorjs/image'
export const EDITOR_TOOLS = {
image: {
class: Image,
config: {
// byFile: `http://localhost:8000/upload/image`,
uploader : {
async uploadByFile(file : any){
// prepare data
const data = new FormData()
data.append('image', file)
// sending data
const req = await fetch(`${process.env.api_url}/file/upload/image`, {
method: 'POST',
body: data
})
const res = await req.json()
return res
}
}
}
},
} |
So, in editor.js the config uploadByFile allows to set a custom function for file upload. But the response returned by the function should be in a specified format as per the editor js documentation. ` uploadByFile(file){
|
Have implemented vue-editor-js is nuxt as per instructions and set up config as per https://github.com/ChangJoo-Park/vue-editor-js#upload-image--110 and added a backend as per https://github.com/ChangJoo-Park/vue-editor-js-imageserver
Problem is the configuration of editor image tools doesn't seem to be working.
The endpoint doesnt seem to have any effect and selecting a file initiates a POST request to my current nuxt path
Request URL: http://localhost:6969/admin/post/new
which responds withInspecting the editor vis this.$refs I can see the

configuration.tools.image
is empty. Should this be displaying the config settings??Here is my component for reference
I'd ultimately like to use the uploader config prop to call a vuex action in
uploadByFile
but nothing in config seems to be having effect at the moment??The text was updated successfully, but these errors were encountered: