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

Extension(ssg) · ⚠️ ReferenceError: window is not defined #35

Closed
yeus opened this issue Dec 30, 2020 · 1 comment
Closed

Extension(ssg) · ⚠️ ReferenceError: window is not defined #35

yeus opened this issue Dec 30, 2020 · 1 comment
Labels
invalid This doesn't seem right

Comments

@yeus
Copy link

yeus commented Dec 30, 2020

Hi thx for this great plugin! I have found the following issue. I am not sure where the problem lies. The SSG version seems to work just fine and I can serve it. But during generation I get this error:

✖ Extension(ssg) · Generating route... /
  › window is not defined
 Extension(ssg) · ⚠️    ReferenceError: window is not defined
  
  - server-bundle.js:1 Module.4edf
    server-bundle.js:1:12697
  
  - server-bundle.js:1 o
    server-bundle.js:1:194
  
  - server-bundle.js:1 Object.0
    server-bundle.js:1:1475
  
  - server-bundle.js:1 o
    server-bundle.js:1:194
  
  - server-bundle.js:1 module.exports.0
    server-bundle.js:1:1436
  
  - server-bundle.js:1 Object.<anonymous>
    server-bundle.js:1:1445
  
  - build.prod.js:1 o
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:77517
  
  - build.prod.js:1 
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:78110
  
  - new Promise
  
  - build.prod.js:1 
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:78018
  
  - build.prod.js:1 Object.renderToString
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:81553
  
  - ssr-config.js:60 Object.module.exports.renderToString
    [comcharax-componardo]/[.cache]/quasar-app-extension-ssg/ssr-config.js:60:12
  
  - generator.js:111 
    [comcharax-componardo]/[quasar-app-extension-ssg]/src/generate/generator.js:111:16
  
  - new Promise
  
  - generator.js:105 Generator.render
    [comcharax-componardo]/[quasar-app-extension-ssg]/src/generate/generator.js:105:12
  
  - generator.js:77 Generator.generate
    [comcharax-componardo]/[quasar-app-extension-ssg]/src/generate/generator.js:77:27

Done in 3.78s.

Any idea what this is about and where it comes from?

@freddy38510
Copy link
Owner

freddy38510 commented Dec 31, 2020

Hi,

It seems that the window object is called somewhere in your app. This object is not available at server side.

Be sure that you write universal code like you would do in SSR mode.

In most cases this is due to a third party library. If you are using some Boot files, you can specify to run it only at client side.

Do not hesitate to continue this discussion if you meet some difficulties to resolve this issue.

@freddy38510 freddy38510 reopened this Dec 31, 2020
@freddy38510 freddy38510 added the invalid This doesn't seem right label May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants