Nuxt.js: asyncData query params always empty

Created on 26 Jul 2020  路  2Comments  路  Source: nuxt/nuxt.js

So, i'm using static mode with nuxt content. I have asyncData to catch query param of page and load my paginated content, but query params are always an empty object. For example localhost:3000/articles?page=3


async asyncData($nuxt) {
    console.log($nuxt.query) // always an empty object
}
bug-report

Most helpful comment

@haykokalipsis This is intentional behaviour. See https://nuxtjs.org/blog/going-full-static/#new-config-option-code-target-code-

All 2 comments

@haykokalipsis This is intentional behaviour. See https://nuxtjs.org/blog/going-full-static/#new-config-option-code-target-code-

image
change target to server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredreich picture jaredreich  路  3Comments

uptownhr picture uptownhr  路  3Comments

lazycrazy picture lazycrazy  路  3Comments

danieloprado picture danieloprado  路  3Comments

shyamchandranmec picture shyamchandranmec  路  3Comments