-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
Support static deployments with ssr: false
#1229
Comments
I like the second option since it will also provide the ability to search for statically generated websites. |
First things first, I want to thank the Nuxt Content team for all of your hard work. You all are amazing developers. That said, I've run into this issue as well. Being able to generate a static distribution of a Nuxt Content v2 site is crucial functionality and the ability to do this was a huge selling point of v1. Requiring a Nodejs server in order to run a Nuxt Content v2 site is not only crippling, but it makes the development vs production flow a nightmare. For example, I have a fully functional (in development) version of an application rewritten for Nuxt Content v2 but it cannot be deployed in the same manner as its v1 counterpart because it blows up with a "You should use slots with " error after running For users without access to a Nodejs server, a static hosting solution is vital. I was actually shocked that this functionality wasn't baked into the stable release (especially after migrating everything over to v2, just to find out later that SSG doesn't currently work). I hoping this issue can be resolved in the near future. Thanks! |
If you take a look at the video at the home page, it works with I believe the |
I believe there should be an endpoint, that prefetches the content during prerender process and we have it with or without |
@pi0 Using that endpoint, contents caches in nitro storage but since pages do not pretender during generation, all query APIs return 404 in production. (all We need to ship query matcher to the client for non-SSR SSGs. |
Good point @farnabaz but t believe this is an expected consequence of using static SPAs anyway for SEO impact. As we discussed, the requirement for SW as the server is for dynamic queries we cannot predict such as search functionality or preview mode which is probably not needed for search engines anyway to be indexed. prerendering API responses should be still possible for static deployments without sw. |
Since the Service Worker presets work as expected, we need to
|
Is there any solution to this or an ETA on when it might get fixed? Currently facing these issues using
for prerendering dynamic routes I've been using
Then making a 2nd API call in the dynamic route, which seems wasteful when previously we could pass the data as a Thanks in advance for any input. Temporary fix: |
There are no We do have a bug for We are still thinking of the best approach to support ssr: false on static hosting. |
Actually this is not correct, "npm run generate" without "ssr: false" is also not working for me. am on rc9 and have tried it about 10 times to make sure. |
@R0N1n-dev could you provide a simple reproduction? |
R0N1n-dev/nuxt3-content-blog |
@R0N1n-dev this happens because you are using |
So basically , no optionsAPI usage fro content v2 in nuxt3. |
What's the status on this? Is this blocked on something? How can we progress on this issue? |
wow, it's been almost 2 years since this issue was opened. My current hacky workaround is to fetch the content for the desired page in an
Any other non hacky updates on this? |
I am writing a blog which is purely static but my design requires me to use queryContent... Because of this I am unable to create static pages... Could this issue be resolved like within next few months. I see it as pretty old but isn't this supposed to be prioritized over other issues... Please close this issue :) |
Just bit me. How is this still open? lol |
Disabling SSR limits the ability to prefetch query endpoints in the generation process and therefore generated website will not contain any content.
There are some approaches we can take to support non-ssr websites:
We can ship nitro into service workers to handle API requests for content APIs and provides content live in production.
Like Content v1 we can expose the whole database to the client using
/api/_content/cache
API (pre-rendered) and search and provide content live in the client.\cc @pi0 @Atinux @Tahul
The text was updated successfully, but these errors were encountered: