Comments (13)
@vandelpavel What happens if you do this:
quasar build -m ssr
from quasar-app-extension-ssg.
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.
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.
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) ·
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.
@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.
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.
I can't reproduce it with the repository you gave.
Try to run quasar build -m ssr --static --debug
from quasar-app-extension-ssg.
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.
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.
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.
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.
I'll close this issue and open another one.
from quasar-app-extension-ssg.
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)
- Automatic patch of ES Module import HOT 2
- Cannot read properties of undefined [pinia store] HOT 1
- error when using meta HOT 1
- ssg gets fallback to SPA when router has query
- Render markdown to SSG
- Missing Vite.js v3/v4 support HOT 7
- searchForWorkspaceRoot is not a function HOT 10
- Demo is no longer can be used as a template HOT 4
- Error [ERR_REQUIRE_ESM]: require() of ES Module inside quasar-app-extension-ssg's server-entry.js HOT 2
- pinia persisted state: storages (session storage) HOT 2
- I get the error message "Cannot find module 'ouch''" when running "quasar ssg dev" on freshly scaffolded quasar project HOT 3
- vue-loader & css-loader throwing errors HOT 12
- minifyOptions error? HOT 1
- Failed to add extension due to workbox-build version HOT 2
- Cannot find module `.cache/quasar-app-extension-ssg/server/server-entry.js` HOT 2
- `TypeError: Cannot read properties of undefined (reading 'get')` in `server-entry.js` during generation HOT 7
- Using Pinia from library results in `TypeError: can't access property "_s", pinia is undefined` HOT 3
- Empty data on all pages except one, when routes uses same component HOT 1
- feat: update to Vite 5 and @quasar/app-vite dependency to ^2.0.0
- ERR_INVALID_ARG_TYPE HOT 7
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 quasar-app-extension-ssg.