Skip to content
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

Not firing @error event on img element #5493

Closed
rhaldkhein opened this issue Apr 9, 2019 · 6 comments
Closed

Not firing @error event on img element #5493

rhaldkhein opened this issue Apr 9, 2019 · 6 comments

Comments

@rhaldkhein
Copy link

Version

v2.5.1

Reproduction link

https://codesandbox.io/s/vy6863v787

Steps to reproduce

  1. Create an image element with invalid path (which will produce not found error)
  2. Bind a method to @error event

What is expected ?

The method should run

What is actually happening?

Not running

Additional comments?

It's working fine when using Vue directly.

This bug report is available on Nuxt community (#c9021)
@ghost ghost added the cmty:bug-report label Apr 9, 2019
@rchl
Copy link

rchl commented Apr 9, 2019

You are not getting error event probably because returned content is an actual image (even though response is 404):

content-length: 43
content-type: image/gif

And it's probably related to feature mentioned in #5483 (serve-placeholder)

@yuxino
Copy link

yuxino commented Apr 10, 2019

As @rchl says this behavior cause by the server-placeholder.

First i comment out the code and start my local nuxt.js cli , the error event will be fire .

And then i cancel comment out the code, add { dist: {}, static: { skipUnknown: true } } to my nuxt.config.js, the error event will be fire too.

@manniL
Copy link
Member

manniL commented Apr 10, 2019

{ dist: {}, static: { handlers: null } } should work as described in https://github.com/nuxt/serve-placeholder

@rhaldkhein
Copy link
Author

Right! It worked after generating static html. I'm not using server on production, so need to set that flag on dev mode. Thanks all.

@manniL manniL closed this as completed Apr 11, 2019
@overtrue
Copy link

overtrue commented Jan 6, 2020

// nuxt.config.js
{
     //...
     render: {
        fallback: false
     }
     //...
}

it works for me.

@simeon9696
Copy link

// nuxt.config.js
{
     //...
     render: {
        fallback: false
     }
     //...
}

it works for me.

None of these suggestions have worked for me. Is there anything else I can do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants