For easy usage of NuxtJS with Nhost.
$ npm install @nhost/nuxt
or
$ yarn add @nhost/nuxt
NuxtJS module for Nhost
Home Page: https://nhost.io
License: MIT License
Is the nuxt module deprecated?
It seems that it is no longer updated or referenced in the doc...
Hello,
With a fresh install of Nuxt (hbp standalone from source), i get an error when calling auth.login :
lgn = await this.$nhost.auth.login({
email: this.login,
password: this.password
});
I get a validation error:
{data: "Error validating request body. \"value\" does not match any of the allowed types.", status: 400, statusText: "", headers: {…}, config: {…}, …}
If i check in dev tools, "cookie": false
is added to the request payload.
Tested the endpoint with postman and it works fine, but if i add "cookie": false
to the payload, i get the same body validation error...
Thanks.
Hello Nhost team,
and first thanks for your amazing and impressive solution, it's a game changer for me (as a front-end developper)!
A simple question, do you plan to support Nuxt 3 ?
Because it's not easy to implement Nhost authentication with Apollo Graphql in Nuxt 3 (some of @nhost/vue composables are not compatible with nuxt 3).
Or maybe a good example will be helpful.
Thanks!
It's great to see that there has been some recent work on this module to make it work with nhost v2 beta. I've been conscious that at some point there will be a need to migrate but wasn't sure where to begin.
After updating my Nuxt 2 project to use nhost/nuxt 0.19, I've noticed that Nuxt gets stuck at loading app if the ssr flag is enabled in nuxt.config.js.
Is this just an issue on my end or is support for SSR with nuxt on nhost still a work in progress?
Firstly, great platform! A couple of things that would make developing with Nuxt & Nhost a better experience with getting started:
{ modules: [ '@nhost/nuxt' ], nhost: { baseURL: "https://backend-REPLACE.nhost.app" // optional other nhost-js-sdk setup options } }
fits into this starting Nuxt Config as an example:
`import colors from 'vuetify/es5/util/colors'
export default {
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
titleTemplate: '%s - yellowstripe',
title: 'yellowstripe',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module',
// https://go.nuxtjs.dev/vuetify
'@nuxtjs/vuetify',
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
vuetify: {
customVariables: ['~/assets/variables.scss'],
theme: {
dark: true,
themes: {
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
},
},
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {},
}
`
As a beginner, I've found this module very helpful in getting started using nuxt with nhost. I followed the instructions from https://docs.nhost.io/libraries/nhost-nuxt
I did however run into an issue that seems to occur after a period of inactivity - maybe when the websocket connection times out? The error message I get from VScode reads:
ERROR Cannot read property 'status' of undefined 08:54:12
at server.js:4337:28
at Auth.authStateChanged (node_modules/nhost-js-sdk/dist/Auth.js:707:13)
at Auth. (node_modules/nhost-js-sdk/dist/Auth.js:722:22)
at step (node_modules/nhost-js-sdk/dist/Auth.js:33:23)
at Object.next (node_modules/nhost-js-sdk/dist/Auth.js:14:53)
at node_modules/nhost-js-sdk/dist/Auth.js:8:71
at new Promise ()
at __awaiter (node_modules/nhost-js-sdk/dist/Auth.js:4:12)
at Auth._clearSession (node_modules/nhost-js-sdk/dist/Auth.js:711:16)
at Auth. (node_modules/nhost-js-sdk/dist/Auth.js:207:30)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.