Questions tagged [nuxt-plugin]
8 questions
2
votes
0 answers
Error while injecting javascript class as a plugin in nuxtjs2
I am trying to inject a javascript class as a plugin.
I get following error: Cannot read property 'log' of undefined
Class to be injected:
// helper/logging.service.js
export class LoggingService {
constructor (prefix) {
this.prefix =…

mahatmanich
- 10,791
- 5
- 63
- 82
2
votes
2 answers
WebStorm 2021.3 shows "Unresolved variable $sdk" when accessing Nuxt.js plugin from component
I'm trying to use Nuxt.js plugins within my project, but WebStorm is not able to correctly recognize what the plugin exposes.
In my case, it's an OpenAPI client, and without autocompletion in WebStorm, I am pretty much unable to work with it at all,…

Marian Klühspies
- 15,824
- 16
- 93
- 136
1
vote
2 answers
nuxt3 how to call pinia store in composeable
Since the nuxt 3.4.0 update the pinia store can no longer be used in composeables.
//example composable
import { useAuthStore } from '~/store/auth-store';
const authStore = useAuthStore();
export function doSomethingWithStore() {
return…

Jean-Pierre Engelbrecht
- 198
- 2
- 10
1
vote
1 answer
How to use Swiper.js(version 8+) in Nuxt(2.15.8)
First I tried this as showed in official Swiper.js website for Vue 3 demo

Rustam Ravshanovich
- 96
- 8
1
vote
0 answers
Nuxt - pusher : refresh a plugin when i log in
For my nuxt app, i need to use pusher for handling websocket.
I use pusher-js, and i created a nuxt plugin to enable pusher throughtout my app.
The problem is that i need to be auth to use pusher.
That my plugin :
import Pusher from…

B.Samuel
- 51
- 1
- 1
- 6
0
votes
2 answers
Nuxt 3 - after response middleware
I have a use-case where I would like to call a middleware after the response went through the route handler. The docs describe that the standard server middleware only runs BEFORE the request is handled…

Schutt
- 1,056
- 6
- 17
0
votes
0 answers
Nuxt instance unavailable in plugins
I want to add google analytics tracking to my app, and I want to connect user UID with activity. So I need to run script every time page is loaded to connect it. From what I know, best way to do this is by creating Nuxt plugin.
I don't have any…

Prokop Lošťák
- 61
- 3
0
votes
0 answers
Nuxt PWA Icon is displaying on the very bottom of the page
I'm trying to add PWA icon on my nuxt app but on chrome browser is rendering on the very bottom of the page can someone help me resolve this issue.
I've put the icon.png file inside my static folder with the name of icon.png,
The icon should not…

UmairAli
- 21
- 4