Skip to content
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

useSWRV error on build #2

Closed
hurricanepkt opened this issue May 23, 2023 · 2 comments
Closed

useSWRV error on build #2

hurricanepkt opened this issue May 23, 2023 · 2 comments

Comments

@hurricanepkt
Copy link

Following commands and when it comes to :

cd ui && npm run build:local

Get error message :

[Vue warn]: Failed to resolve component: ErrorSummary
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: TextInput
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: CheckboxInput
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: SecondaryButton
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: PrimaryButton
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.
[Vue warn]: Component <Anonymous> is missing template or render function.
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.
[Vue warn]: Component <Anonymous> is missing template or render function.
file:///C:/Users/mark.greenway/Desktop/Repos/yyy_trash/Lisa/ui/node_modules/vite-ssg/dist/shared/vite-ssg.62550b28.mjs:1046
        throw new Error(`${gray("[vite-ssg]")} ${red(`Error on page: ${cyan(route)}`)}
              ^

Error: [vite-ssg] Error on page: /
TypeError: useSWRV is not a function
    at SwrClient.get (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\.vite-ssg-temp\main.cjs:343:12)
    at setup (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\.vite-ssg-temp\assets\Index-65dd2db6.cjs:392:44)
    at _sfc_main$3.setup (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\.vite-ssg-temp\assets\Index-65dd2db6.cjs:406:25)
    at callWithErrorHandling (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:171:22)
    at setupStatefulComponent (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7194:29)
    at setupComponent (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7149:11)
    at renderComponentVNode (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:628:17)
    at Object.ssrRenderComponent (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:94:12)
    at C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\.vite-ssg-temp\assets\Index-65dd2db6.cjs:645:28
    at renderComponentSubTree (C:\Users\mark.greenway\Desktop\Repos\yyy_trash\Lisa\ui\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:710:17)
    at file:///C:/Users/mark.greenway/Desktop/Repos/yyy_trash/Lisa/ui/node_modules/vite-ssg/dist/shared/vite-ssg.62550b28.mjs:1046:15
    at async run (file:///C:/Users/mark.greenway/Desktop/Repos/yyy_trash/Lisa/ui/node_modules/vite-ssg/dist/shared/vite-ssg.62550b28.mjs:627:36)

Node.js v20.2.0

Full Source code here : https://github.com/hurricanepkt/Lisa

@mythz
Copy link
Contributor

mythz commented May 24, 2023

It looks like it's failing on the SSG build of useSWRV so I've just replaced it with our client.swr that's now built-in to @servicestack/vue in this commit: NetCoreTemplates/vue-ssg@e9e8931

This issue should now be resolved in new vue-ssg templates.

@mythz mythz closed this as completed May 24, 2023
@mythz
Copy link
Contributor

mythz commented May 24, 2023

FYI I've added a nicer swrEffect replacement in this commit NetCoreTemplates/vue-ssg@fc6c45d which uses Vue's watchEffect to detect property changes to simplify usage down to a wrist friendly syntax:

const api = client.swrEffect(() => new Hello({ name: props.name }))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants