question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'req' of undefined

See original GitHub issue

Seems to happen at setActiveReq(context.ssrContext.req);

"nuxt": "^2.11.0",
"nuxt-composition-api": "^0.9.0",
"@vue/composition-api": "^0.6.1",
"pinia": "0.0.6",

universal mode

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danielroecommented, Jun 13, 2020

It was intended for you, not the users… 😄

However, I was mistaken on the cause; it’s not one of the packages overwriting the other’s setup function. I’ve submitted a PR.

1reaction
danielroecommented, Jun 13, 2020

@posva I’ve now exposed a onGlobalSetup hook that could work for Nuxt users like:

// In a plugin file
import { onGlobalSetup } from 'nuxt-composition-api'
import { setActiveReq } from 'pinia' // if this is exposed

export default () => {
  onGlobalSetup((props, context) => {
    setActiveReq(context.ssrContext.req)
  })
}

Let me know if there is anything else I can do from the nuxt-composition-api end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express.js Cannot read property 'req' of undefined
My Express. js app has been throwing Cannot read property 'req' of undefined . In essence, it listens for a GET request, grab...
Read more >
Cannot read property req body undefined in express - YouTube
codercrab #express #body-parserCannot read property req body undefined in express ||Express req body is undefined for post requests.
Read more >
TypeError: Cannot read property 'req' of undefined · Issue #711
Error that I described is happening only client-side, so I am guessing that it caused by destroyed component. All reactions.
Read more >
getting "TypeError: Cannot read property 'quote' of undefined ...
getting "TypeError: Cannot read property 'quote' of undefined" The terminal shows the error at app.js 22:23. const express = require('express'); ...
Read more >
Javascript – Express.js Cannot read property 'req' of undefined
My Express.js app has been throwing Cannot read property 'req' of undefined . In essence, it listens for a GET request, grab the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found