wobsoriano / vue-clerk

Community Clerk Vue SDK.
https://vue-clerk.com
MIT License
144 stars 13 forks source link

Clerk provider not found #2

Closed jofftiquez closed 8 months ago

jofftiquez commented 1 year ago

So I was testing vue-clerk in nuxt coz I wanna update the docs to add Nuxt installation guide, but somehow I got this error

Clerk provider not found

Facts:

Here's my setup:

// nuxt plugin 
// vue-clerk.client.js

import { defineNuxtPlugin, useRuntimeConfig } from '#imports';
import { clerkPlugin } from 'vue-clerk';

export default defineNuxtPlugin({
    setup (nuxtApp) {
        const runtimeConfig = useRuntimeConfig();
        const clerkPublishableKey = runtimeConfig.public.clerkPublishableKey;

        console.log(clerkPublishableKey); // has value

        nuxtApp.vueApp.use(clerkPlugin, {
            publishableKey: clerkPublishableKey,
        });
    },
});
// .env

CLERK_PUBLISHABLE_KEY=pk_test_c3dl...Rlax4 # reducted
// nuxt.config.js

...

runtimeConfig: {
    public: {
        clerkPublishableKey: process.env.CLERK_PUBLISHABLE_KEY,
    }, 
},

plugins: [
    '~/plugins/vue-clerk.client.js',
]

...

Screenshot

image

wobsoriano commented 1 year ago

Yo! You also need to add the clerk-js module to build.transpile. I have a Nuxt template actually if you want to check out - https://github.com/wobsoriano/nuxt-clerk-template

jofftiquez commented 1 year ago

Yo! You also need to add the clerk-js module to build.transpile. I have a Nuxt template actually if you want to check out - wobsoriano/nuxt-clerk-template

Nice! Thanks @wobsoriano got it. Will review and update this issue, thanks!

atinux commented 1 year ago

When the vue-clerk/nuxt module? 😜

wobsoriano commented 1 year ago

@Atinux soon! :)

wobsoriano commented 8 months ago

Let me know if are still experiencing this issue! There's a Nuxt template for now - https://github.com/wobsoriano/nuxt-clerk-template