-
Notifications
You must be signed in to change notification settings - Fork 15
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
TypeError: Cannot read properties of undefined (reading 'get')
in server-entry.js
during generation
#375
Comments
I've just tested throwing an error from IndexPage.vue, using Node.js v21.2.0, and the stack trace is perfectly readable. The same applies when throwing an error from a Quasar boot file. The error may come from an external library that has already been minified. Could you try running the As a last resort, please try the The minify option is set here. |
Hi. Sorry for the delay.
That Anyway, this looks different from the previous error, as one is for the missing property |
I tried to add But making the Apart from this issue, you'll come across other errors linked to the use of web functionalities not available on nodejs. Such as the |
Thanks for the information. Indeed I'm aware of the difference between frontend and backend (node), and am trying my best to not running into problems related to that (i.e. I'm trying to write a front-end application as website only); however, due to my limited experience with JS, my practice may very likely miss things. I managed to solve the
|
SSG is like SSR but at build time. This means that each page is pre-rendered server-side, with the result then written to an html file. When the app runs in browser (client-side), the static markup is hydrated by Vue to make it interactive. So, when you need to perform conditional logic based on SSR vs. client, you can use if (process.env.CLIENT) {
// client-only logic
import('my-fancy-npm-package').then(package => {
// notice "default" below, which is the prop with which
// you can access what your npm imported package exports
package.default.doSomething()
})
// access window global variable
console.log(window)
} You can also access the Quasar boot files can also be executed only at client or server side: 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
}
] If you have components that are difficult to adapt to the server, you can use the Quasar No SSR component to run them client-side only. About your library, the Rollup external option is used for deps that should remain external to the bundle. It is fine to make the So, contrary to what I said, it's not specific to the UMD format. In fact, the issue with this specific package is not strictly about making it external or not. When you compile and bundle your library with its deps, Vite imports the From the
By default Vite will use the I don't have much time to look for a suitable solution to this problem, but I hope that from now on you'll have a better understanding of what it's all about. |
Thanks very much for the patient and detailed explanation. That now makes a lot of sense. And thanks for the information about |
That's right. You can read the documentation on SSR and SSG directly on the Vue website, it contains better explanations than mine. I've got some rewritten documentation in the pipeline and a few features, but I'm running out of time these days to deliver them properly. Thanks for the feedback, it's always very useful ! |
While building static site, I encounter this error:
I have set
minify: false,
inquasar.config.js
, but as you can see, the error message is not very helpful on its own. Guess this code is from quasar-app-extension-ssg, which has been minified already.The command I used and my environment is:
The text was updated successfully, but these errors were encountered: