Closed esbeto closed 1 year ago
Hi there, thanks for opening an issue!
Can you try setting your paths like so? (with the ~
prefix)
{
client: "~/app/prismic/client.ts",
linkResolver: "~/app/prismic/link-resolver.ts",
// ...
}
I'm afraid your current setup tries to resolve those paths from your disk root (e.g. c:/app/prismic/client.ts
) because of the leading /
.
Just a quick note, the client path you're trying to use is the default path the module uses, so you could also simply omit it and the module should be able to resolve it on its own.
Likewise, for the link resolver path, the default path just uses camelCase
instead of kebab-case
and the module will be looking for a link resolver at ~/app/prismic/linkResolver
(.js
or .ts
) by default.
In any case, if the module successfully finds your files, it'll prompt it in the console.
Few not-so-related notes:
clientConfig
option is only useful when you don't provide a client yourself, it will be ignored if the module finds a client you provided at the specified (or default) path it looks for one.prismic-ts-codegen
according to your snippet, @prismicio/client
document types can be inferred by default on your client (no need to provide a generic) if you turn on/leave on the clientIntegration
option: https://prismic.io/docs/technical-reference/prismic-ts-codegen#automatic-prismicioclient-integration Let me know if anything :) If everything's alright, feel free to close the issue~
By using the default settings I was able to get everything working correctly. Thanks a lot for the detailed explanation it was worth the effort 🙇
You're very much welcome!
Versions
Reproduction
Hi, I'm testing out the latest and greatest prismic with Nuxt3, spend a few hours trying to get urls working.
I noticed the following, when setting the routes option in
nuxt.config
it works:But if I move this config to createClient, it doesn't work:
Steps to reproduce
nuxt.config.ts
What is Expected?
I'm not sure what's the difference, and where it would make more sense to place this configuration. The fact that you can place the same configuration settings in two places made it very confusing to me, especially since I'm just getting familiarized with prismic.