Comments (6)
Can you provide a boiled down repro using nuxt-composition-api? https://github.com/nuxt-community/composition-api
from pinia.
Not sure if it's related to the Nuxt Composition API updates @spetex mentioned, but I'm experiencing the same issue as in #179, I'm currently using the latest Nuxt version and I'm wondering if this is the root of the issue
Everything builds fine but then the Cannot read property 'req'
is returned when trying to access any page. In case it's useful, this is what my package.json
and nuxt.config.js
look like respectively:
// package.json
{
"name": "nuxt",
"version": "1.0.0",
"description": "A description",
"author": "Christian George Echevarria-Reina",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt-ts build",
"old_start": "nuxt-ts start",
"start": "nuxt-ts",
"export": "nuxt-ts export",
"serve": "nuxt-ts serve",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"test": "jest"
},
"dependencies": {
"@nuxtjs/apollo": "^4.0.1-rc.1",
"@nuxtjs/dotenv": "^1.4.0",
"@nuxtjs/pwa": "^3.0.0-0",
"@tailwindcss/ui": "^0.3.0",
"apollo-cache-inmemory": "^1.6.6",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"graphql-tag": "^2.10.3",
"nuxt": "latest",
"nuxt-composition-api": "^0.10.6",
"pinia": "0.0.7",
"tailwindcss": "^1.4.6"
},
"devDependencies": {
"@babel/runtime-corejs3": "^7.10.1",
"@nuxt/types": "^2.13.3",
"@nuxt/typescript-build": "^2.0.0",
"@nuxtjs/eslint-config": "latest",
"@nuxtjs/eslint-module": "latest",
"@nuxtjs/tailwindcss": "~2.0.0",
"@vue/test-utils": "latest",
"babel-eslint": "latest",
"babel-jest": "latest",
"core-js": "^3.6.5",
"eslint": "latest",
"eslint-config-prettier": "latest",
"eslint-plugin-nuxt": "latest",
"eslint-plugin-prettier": "latest",
"jest": "latest",
"prettier": "latest",
"vue-jest": "latest"
}
}
and
// nuxt.config.js
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: process.env.npm_package_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || '',
},
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: 'https://rsms.me/inter/inter.css' },
],
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
*/
plugins: ['~plugins/filters.js'],
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/nuxt-tailwindcss
'@nuxtjs/tailwindcss',
'@nuxt/typescript-build',
'pinia/nuxt',
'nuxt-composition-api',
],
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/pwa',
// Doc: https://github.com/nuxt-community/dotenv-module
'@nuxtjs/dotenv',
'@nuxtjs/apollo',
],
// Give apollo module options
apollo: {
cookieAttributes: {
expires: 7, // optional, default: 7 (days)
},
includeNodeModules: true, // optional, default: false (this includes graphql-tag for node_modules folder)
authenticationType: 'Bearer', // optional, default: 'Bearer'
// optional
errorHandler: '~/plugins/apollo-error-handler.js',
// required
clientConfigs: {
default: '~/apollo/clientConfig.js',
},
},
serverMiddleware: ['~/api/index'],
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {},
babel: {
configFile: './babel.config.js',
},
},
}
I'm going to try rolling back Nuxt to see if it would work in versions lower than 2.12.x and report back the results
from pinia.
Update: tried rolling back to 2.12.2 and fixed this particular issue -- although I had another issue where Nuxt would just refresh non-stop, can't say with certainty that it was related to this
from pinia.
Could you post a woring demo with pinia an nuxt?
from pinia.
Closing due to inactivity. Please open a new issue with a reference to this one if you can follow up with more information.
from pinia.
This seems to be another occurence of #161. Previous check is not enough because at some point context.nuxtState
started existing in spa mode as well.
from pinia.
Related Issues (20)
- Unable to test setup store actions with watcher HOT 1
- Component not updating (even though data is updated in devtools) when using external class to change data in Pinia Store [Nuxt 2/Bridge]
- `_UnwrapAll` not working when pinia stores is from npm package HOT 1
- $subscribe doesn't trigger if only computed is returned from the store HOT 1
- When I defineStore, if I use the same id as another Store, the data is not rendered to the page and no error is reported in the console. HOT 1
- Nuxt3 Store $patch returns error on production HOT 2
- error TS2536: Type 'key' cannot be used to index type 'Store<string, S, G, {}>
- Cant create an async store HOT 2
- Ability to manually trigger plugin action subscriptions within a setup store HOT 1
- acceptHMRUpdate skips optional attributes without default values HOT 3
- Pinia Eslint plugin HOT 9
- Typings for refs seem to be wrong in setup store HOT 3
- TS(7022): implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer HOT 1
- Using Pinia app crashes with Error: The requested module 'vue-demi' does not provide an export named 'hasInjectionContext'
- The inferred type of 'default' cannot be named without a reference to '.pnpm/[email protected][email protected][email protected]/node_modules/pinia'. This is likely not portable. A type annotation is necessary.ts(2742) HOT 1
- Computed does not work in nested store
- In Pinia, the `watch` function fails to capture changes to object properties within the `state`.
- Composition API documentation HOT 1
- mapActions does not work with parameters HOT 1
- Return type of storeToRefs doesn't match runtime result if values are nested computed values HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinia.