Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers Not found #123

Closed
essamamdani opened this issue Apr 5, 2018 · 3 comments
Closed

Headers Not found #123

essamamdani opened this issue Apr 5, 2018 · 3 comments
Labels

Comments

@essamamdani
Copy link

essamamdani commented Apr 5, 2018

When I do

$> yarn generate 

I got an error in the storage file.


  TypeError: Cannot read property 'headers' of undefined
  
  - server-bundle.js:4195 Storage.getCookie
    server-bundle.js:4195:63
  
  - server-bundle.js:4045 Storage.getUniversal
    server-bundle.js:4045:20
  
  - server-bundle.js:4057 Storage.syncUniversal
    server-bundle.js:4057:22
  
  - server-bundle.js:3709 Auth.init
    server-bundle.js:3709:19
  
  - server-bundle.js:3652 module.exports.__webpack_exports__.a
    server-bundle.js:3652:16
  
  - server-bundle.js:1545 createApp
    server-bundle.js:1545:199

it seems issue in storage.js file.

const cookieStr = process.browser
      ? document.cookie
      : this.ctx.req.headers.cookie
@ghost ghost closed this as completed Apr 5, 2018
@ghost ghost added the cmty:question label Apr 5, 2018
@essamamdani
Copy link
Author

@pi0 Can you answer this? I am stuck with that.

@breakingrobot breakingrobot reopened this Apr 5, 2018
@pi0
Copy link
Member

pi0 commented Apr 5, 2018

Hi @essamamdani. If you have a dynamic website with authentication enabled, i think the best way would be to use spa mode (nuxt build --spa --generate)

@essamamdani
Copy link
Author

Thank you @pi0. You are the man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants