Coder Social home page Coder Social logo

Comments (13)

hawkeye64 avatar hawkeye64 commented on June 19, 2024

@vandelpavel What happens if you do this:

quasar build -m ssr

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

With quasar build -m ssr it works.
I also tried quasar build -m ssr --static wich is the one in the read-me and it's no long working.

from quasar-app-extension-ssg.

freddy38510 avatar freddy38510 commented on June 19, 2024

@vandelpavel, @hawkeye64

I tried to run quasar build -m ssr and the build complete fine.

But if you start the standalone webserver with node index.js inside the previously generated folder dist/ssr you've got the same error than with quasar ssg build.

So i added the dependency for transpiling with babel, then there is no more error and the animations works great.

transpileDependencies: [/@dreamonkey[\\/]quasar-app-extension-animate/]

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

Ok cool now it works thanks!
But before closing the issue i would like to ask another quesion. That was just a reoro case so when i added the line on the original project the console throws 'Extension(ssg) · ⚠️ ReferenceError: window is not defined'
I think thaqt the problem may be the same that on server/side window can not be used.. But i cant find where is used.
I'm inesperienced so any help or a hint on what i should do to find a solution would be very helpfull!

from quasar-app-extension-ssg.

freddy38510 avatar freddy38510 commented on June 19, 2024

@vandelpavel could you give us more details ?

What is a "reoro case" ?

when i added the line on the original project

Which line are you talking about ?

You are right about window it's a browser-only global that you cannot access from server-side.

The stack trace of the error could help a lot.

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

Sorry i ment "repro case", the github repository to reproduce the error.
The line that you supplied:
transpileDependencies: [/@dreamonkey[\\/]quasar-app-extension-animate/]
The problem is that it doesn't really give an actual stack trace.... Here is the log:

...
 App · Extension(ssg): Running afterBuild hook...
 Extension(ssg) · Generating route /...
[  ReferenceError: window is not defined

  - 1.92e8cf77.js:1 L
    js/1.92e8cf77.js:1:11858

  - 1.92e8cf77.js:1 r
    js/1.92e8cf77.js:1:11620

  - 1.92e8cf77.js:1 Module.eea6
    js/1.92e8cf77.js:1:58898

  - server-bundle.js:1 n
    server-bundle.js:1:194

  - task_queues.js:97 processTicksAndRejections
    internal/process/task_queues.js:97:5

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

from quasar-app-extension-ssg.

freddy38510 avatar freddy38510 commented on June 19, 2024

I can't reproduce it with the repository you gave.

Try to run quasar build -m ssr --static --debug

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

I was trying to modify the previeus repro but unfortunally when creating other pages it keeps saying "404 on /" when changing the path.
It works just if the path doesn't have a layout like so:

{
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/Index.vue') }]
  },
  {
    path: '/p',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/Page-two.vue') }]
  },```

But assume that we have something like: 
...
path: '/',
    component: () => import('layouts/frame.vue'),
    children: [
      { path: '', component: () => import('pages/home.vue') },
...

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

I just realized that on the repo works but not on the project. I don't know why.... I just deleted node modules, quasar folder

from quasar-app-extension-ssg.

freddy38510 avatar freddy38510 commented on June 19, 2024

I think that you missed an uppercase.

layouts/frame.vue doesn't exist.
Does layouts/Frame.vue exists ?

If you can't find where the global window is used in your project files, maybe it is coming from some dependencies you are importing. Try to import them only at client side.

With Quasar you can use process.env.SERVER or process.env.CLIENT in your Vue components.

If you are using boot files it's even easier. Quote from Quasar docs :

When building a SSR app, you may want some boot files to run only on the server or only on the client, in which case you can do so like below:

boot: [
 {
   server: false, // run on client-side only!
   path: '<name>' // references /src/boot/<name>.js
 },
 {
   client: false, // run on server-side only!
   path: '<name>' // references /src/boot/<name>.js
 }
]

You could also try to debug errors by putting the parameter debug to your Quasar command.
quasar build -m ssr --static --debug

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

No uppercase error, they are reported on log fortunally.
Actually now the problem as i said "I was trying to modify the previeus repro but unfortunally when creating other pages it keeps saying "404 on /" when changing the path." (probably i wasn't clear sorry) the problem is the routing.

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

I'll close this issue and open another one.

from quasar-app-extension-ssg.

vandelpavel avatar vandelpavel commented on June 19, 2024

By the way i found why it was saying that window was not defined.
I discovered that window was used inside a mixin (As you said)
If you can't find where the global window is used in your project files, maybe it is coming from some dependencies you are importing. Try to import them only at client side.

from quasar-app-extension-ssg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.