No clarity on how to create a client side component WITH a node_modules/.js file and use it in a page. #13553
Replies: 3 comments 5 replies
-
|
You have all the details related to quasar here: https://quasar.dev/quasar-cli-vite/boot-files#usage-of-boot-files For the rest please check the Vue docs, or the docs of what you are using |
Beta Was this translation helpful? Give feedback.
-
|
The rest is not related to Quasar, but to how Vue/Vue SSR/that script/JS works. |
Beta Was this translation helpful? Give feedback.
-
|
This was solved by simply putting the call to instantiate the wordcloud inside It doesn't matter whether you put a component inside a QNoSsr component, it still renders server-side it seems.
Disappointed that you closed the discussion instead of discussing anything. Documentation about What the QNoSsr component use-cases are would also be nice. A catch inside Quasar for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
There is no proper documentation on integrating a JS file (for example wordcloud) inside an SSR enabled project, inside a page or component.
Yes there's a QNoSsr component but this does not address the problem, ok so the Template doesn't load but how do you manage the Imports in the
<script setup>?Putting the import inside a component inside a
QNoSSRstill runs the import server-side, running the file, causing an error and the library is useless.How do you dynamically import without creating an invalid template?
I'm using (!process.env.SERVER) as well around an attempt at a runtime client-side import but the import runs on the server anyway resulting in
documentundefined errors.I expect such errors when it runs server side but what's the point of 'client side checks' if it just gets ignored and it all runs on the server...
The documentation needs a clear example of a small working integration of any third party .js file (preferably inside a TS context) so that it's not complete guesswork to implement.
If you can suggest any alternative for the meanwhile or a specific documentation link you think I may have missed, I'd appreciate it greatly.
https://quasar.dev/quasar-cli-webpack/developing-ssr/ssr-frequently-asked-questions
Documentation Section URL
https://quasar.dev/quasar-cli-webpack/developing-ssr
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar), TypeScript Support, SSR Mode, PWA Mode
Beta Was this translation helpful? Give feedback.
All reactions