Cannot add any custom directive (locally or globally)
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.13.0
- Nuxt Version:
3.0.0-27277498.850ef69
- Package Manager:
npm@8.1.0
- Bundler:
Vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Describe the bug
It’s impossible to add any custom directive (locally or globally).
I get this:
[SSR] Error transforming /Users/Me/Desktop/nuxt3-app/pages/index.vue: SyntaxError: Custom directive is missing corresponding SSR transform and will be ignored.
Reproduction
https://codesandbox.io/s/elastic-frog-4c8fr?file=/pages/index.vue
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
How do I define a custom directive using composition API in ...
Use the directive in the component's template like <div my-directive></div> . Preferably without having to add boilerplate like registering the ...
Read more >Custom Directives | Vue.js
Similar to components, custom directives must be registered so that they can be used in templates. In the example above, we are using...
Read more >Creating Your First Vue Custom Directive - with Vue 3 Updates
A Vue custom directive is, as you may guess, Vue's way of letting us build additional directives for our projects.
Read more >A deep dive into custom Vue directives - LogRocket Blog
Using the cloneNode and prepend JavaScript functions of the Web API, it is simple to copy a node and add it to an...
Read more >Custom Directives in Vue JS - This Dot Labs
To register a custom directive locally, navigate to the component where you want to use the custom directive, and add the method below...
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
Hi.
Adding the patch from this post patch-vue-directive-ssr solved the issue with styleclass/ripple primevue directives. Helmes, please try, hope it works for you as well. Do not forget to remove the vue compilerOptions from nuxt.config.
Boomer! Started experiencing Vue Hydration Node Mismatchs. Perhaps the patch uncover something I’m doing wrong. Update: The Node Mismatchs are being created by Toast.
in nuxt config try add this