Git Product home page Git Product logo

Comments (7)

robinhuy avatar robinhuy commented on May 17, 2024 2

error.vue is only work on 1 level route, ex: /foo.
In multiple level route, the default page will display instead of the error.vue, ex: /foo/bar.
If I use function error({ statusCode: 404, message: 'Page not found' }), error.vue is not working too.

from nuxt.

alexchopin avatar alexchopin commented on May 17, 2024

Hi, that's right it not on the documentation yet but will comes soon but it's possible.

You need to create a /pages/_error.vue file.
There is an example here on how we use it on nuxtjs.org.

from nuxt.

carcinocron avatar carcinocron commented on May 17, 2024

Which probably refer's to this now: https://github.com/nuxt/nuxtjs.org/blob/3d1d3d02616283b3001e638b44c8b99a2ad4a23f/layouts/error.vue

from nuxt.

ymatuhin avatar ymatuhin commented on May 17, 2024

Is it possible to somehow change the value of title meta tag on error page?

from nuxt.

jamesAtcodeninja avatar jamesAtcodeninja commented on May 17, 2024

I'm using nuxt 1.1.1 and the following snippet does not work for me in error.vue. It works in other pages however.

   head () {
      return {
        title: 'Error 404'
      };
    }

from nuxt.

qm3ster avatar qm3ster commented on May 17, 2024

@jamesAtcodeninja probably no such hook in the error case, since it's a minimal setup.
(What if whatever caused the error runs when trying to render a page displaying the error)

from nuxt.

lock avatar lock commented on May 17, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.