-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Vite SSR issue 1.x #13
Comments
Hey @chemeng Thanks for flagging this! this should only be in development for debugging purposes, I'll look to get this fixed in the next few days. |
awesome, let me know when it's cleaned up :) |
Hi @harlan-zw thank you. After upgrading, everything broke for me and now I'm trying to migrate to v1 following the documentation but I think there is a mistake in the docs. for manual imports it says |
Hey @chemeng I'm guessing you're using Vite? Make sure you have the plugin installed and you have the import { SchemaOrg } from '@vueuse/schema-org-vite'
export default defineConfig({
plugins: [
// ...
SchemaOrg({
// use simple types
full: false,
// write type alias to tsconfig.json
dts: true,
}),
],
// ..
}) You can alternatively try importing from If you have other issues let me know, happy to work with you on getting it up and running |
@harlan-zw Yeah I'm using Vite with SSR. I did the import
In the docs it looks like app.use is not needed anymore. |
Can I have some details about your project or a reproduction repo? I have attempted to replicate issues using Vite SSR and it seems to be working correctly https://stackblitz.com/edit/vitejs-vite-vsf3sy Using the alias is preferred as it should avoid this warning. Does any schema generate at all even with it? |
hey @harlan-zw it's a bit tricky to generate a standalone repro (it's a big app) but I'll work on this the next few days and get back to you |
No worries @chemeng as a quick solution you can try out the latest version Note, in this version you should import as I'll have proper release docs once it's fully tested vite.config.ts
|
Hey @chemeng With the v2 release, your issue should be hopefully solved once and for all. If you have any issues with the migration let me know. |
@harlan-zw I think we now have a different problem. Somehow the schema is rendered in the body and not the head element. Shouldn't the position be returned in this? |
Thanks for flagging that @chemeng, I've pushed up a fix in 2.0.1. The tag in the body is the recommended approach though just FYI |
yeah, I left it there, just thought I'd point it out in case anyone really needed the head option |
Hey, thank you for the package, works great!
One question I have is regarding this line: https://github.com/vueuse/schema-org/blob/main/packages/schema-org/createSchemaOrg/index.ts#L136
This
data-ssr: false
shows up in the final output and some validators give out a warning. Is there a reason to have it?The text was updated successfully, but these errors were encountered: