Custom directive is missing corresponding SSR transform and will be ignored
See original GitHub issueI’m currently trying to implement vue3-lazyload package to lazy load some of my images.
modules/lazyload.ts
import { UserModule } from "../utils/types";
export const install: UserModule = async ({ isClient, router, app }) => {
if (!isClient) return;
const vueLazyLoad = await import("vue3-lazyload");
app.use(vueLazyLoad.default || vueLazyLoad, {
log: false,
lifecycle: {
loading: () => {
console.log('loading...')
},
error: () => {
console.log('error loading image...')
},
loaded: () => {
console.log('loaded')
}
}
});
};
and then I have this within my component template
<template>
<img v-lazy="{ src: 'image source', loading: '/img/placeholder.jpg', error: '/img/placeholder.jpg' }" alt="title"/>
</template>
However it works on development, but when I run build I get this error
SyntaxError: Custom directive is missing corresponding SSR transform and will be ignored.
Please any solution to fixing this will be appreciated?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Custom directive is missing corresponding SSR transform and ...
SyntaxError: Custom directive is missing corresponding SSR transform and will be ignored. at Object.createCompilerError (C:\study\cfsw\ ...
Read more >How to make custom directive in Vue.js 3? - Stack Overflow
I got error like "Cannot read property 'created' of undefined" in console. And nothing is displayed. createApp is missing, I editted my question ......
Read more >Custom directive is missing corresponding SSR ... - 博客园
关于在vue3.0中使用ssr/ssg渲染时出现Custom directive is missing corresponding SSR transform and will be ignored.
Read more >Custom directive is missing corresponding SSR transform and ...
关于在 vue3.0 中使用 ssr/ssg 渲染时出现 Custom directive is missing corresponding SSR transform and will be ignored. 错误的修复。
Read more >I have problem with new v-directive in nuxt3 project
vue: Custom directive is missing corresponding SSR transform and will be ignored. ... [Vue warn]: Invalid vnode type when creating vnode: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem. Assuming your custom directives are named
v-custom-directive1
andv-custom-directive2
you can fix it for ssr by adding the following code to the vue plugin in your vite config.https://github.com/vuejs/vitepress/issues/92#issuecomment-877665850