rxsto
The 'credentials' field on 'RequestInitializerDict' is not implemented.
Hey there, I am using NuxtHub to deploy to Cloudflare Pages and implemented authorization via session cookies. In order to forward the client cookies to the nuxt server when pre-rendering the page on sever-side I use the following code:
Specifically the part with
headers: useRequestHeaders(['cookie'])
and credentials: 'include'
, but it seems like the Request implementation on Cloudflare Pages/Workers does not include the credentials
field.
I am now wondering if there is a possibility to work around this issue? It feels like doing something like this should be possible, but I can't find any solution that would fix this problem.
Any insight as to how I can proceed here would be greatly appreciated!
Thanks (please ping me if you have an idea) 😊2 replies
Is it possible to get pre-defined data from `components:extend` hook?
As of now I'm able to get a certain list of components that I have defined in
~/components/dashboard/sections
, and would like to create a runtime list of metadata when building my nuxt app. Is there any way to define custom metadata on components that can be read in this build-time hook?
The code I have so far:
Thanks!1 replies
How should I use components as values in objects?
I want to simplify and automate the implementation process of a dashboard I'm helping to build, and I am struggling to use imported components as values on objects that are defined by typescript interfaces.
Somewhere in the center of the codebase there's a dynamic
<component>
with the accompanying :is="someValue"
attribute. This component tag with its attribute needs to resolve a reactive dynamically passed component which would be part of an object describing the section of the dashboard. This object is defined by a typescript interface as follows:
When constructing such a Section object I want to pass along the actual imported component that will then later be rendered via the <component :is="someReactiveValue">
tag.
I would collect the components in an index.ts like this:
And then later reuse them like this:
How would I go about doing this properly? I've tried typing the component
property of the interface with the DefineComponent
type, which didn't really work, since it gave me overload errors, as well as the need to actually export the interface since the file turned into a module.
Also: a bonus would be if I could ditch the whole interface thing by aggregating the components I need to render programmatically by collecting the from a specific directory. I haven't yet found a way for doing that properly, but maybe there's is some wizardry built into nuxt that could allow me to collect components as an array from a specific directory.
Would appreciate any help! (feel free to ping) :pepoLove:9 replies
Disable/purge nuxt devtools from project
I am trying to fully disable or completely purge the nuxt devtools from my project, as it is creating several issues when running the app in an iframe.
Using
nuxi devtools disable
, which results in the following
is seemingly not enough to properly disable all devtools-related packages. I am seeing following error in my console:
I would expect any devtools-related packages (such as vite-plugin-vue-inspector) to be disabled and not accessed when running the app in development.
Am I doing something wrong, or am I missing something specific?
Thanks1 replies
Why are custom data attributes not being included on the initial load of server-side render?
When adding custom data attributes to standard HTML tags you'll find them missing on the first server-side render. Only after changing pages the data attributes show up. By turning off
treeShakeClientOnly
this issue vanishes. Any idea why this might be happening?1 replies