HapLifeMan / nuxt-trustbox-module

A NuxtJS module thats injects Trustpilot TrustBox code and provide a `<trustbox />` component
https://yzm19.sse.codesandbox.io/
MIT License
7 stars 0 forks source link

Support for Nuxt3 #27

Open mathijsfr opened 2 years ago

mathijsfr commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Nuxt3 with nuxt-trustbox-module currently gives locale is not defined error.

Describe the solution you'd like Support for Nuxt3

Describe alternatives you've considered

Additional context

Trustbox code:

<client-only>
     <trustbox
                template-id="---"
                locale="nl-NL"
                style-height="150px"
                style-width="400px" />
</client-only>

Nuxt config:

[
            'nuxt-trustbox-module',
            {
                businessunitId: '-------',
                businessunitName: '---------',
                locale: 'nl-NL'
            }
        ]

The following error is produced:

ERROR [unhandledRejection] locale is not defined

HapLifeMan commented 2 years ago

Hello, thanks for submitting this issue.

I'm not using Nuxt3 yet but I'll upgrade my projects as soon as a stable version is released. Can you provide a reproduction link please so I can fix it quickly? Thanks!

agracia-foticos commented 1 year ago

the first stable version of nuxt 3 has already been released

agracia-foticos commented 1 year ago

Good morning, is there an expected release date? Thank you very much in advance

HapLifeMan commented 1 year ago

Hello, I still didn't upgrade to Nuxt3 and have no time lately to work on it, sorry :( If you can add the compatibility by sending a PR I'll be able to merge it of couse!

gregoirepuget commented 1 year ago

will love upgrade for Nuxt3 too.

HapLifeMan commented 1 year ago

Hello, could you please take a look at this branch, it should work with Nuxt3. https://github.com/HapLifeMan/nuxt-trustbox-module/tree/nuxt3

I'll make an update of the repo with proper versioning when I'll be able to have it working for Nuxt2 & Nuxt3 on the same branch.

agracia-foticos commented 1 year ago

Hello, could you please take a look at this branch, it should work with Nuxt3. https://github.com/HapLifeMan/nuxt-trustbox-module/tree/nuxt3

I'll make an update of the repo with proper versioning when I'll be able to have it working for Nuxt2 & Nuxt3 on the same branch.

Not runs,

` ERROR [unhandledRejection] Nuxt instance is unavailable!

at useNuxt (node_modules/@nuxt/kit/dist/index.mjs:32:11) at addComponent (node_modules/@nuxt/kit/dist/index.mjs:659:16) at initNuxt (node_modules/nuxt/dist/index.mjs:2401:3) at async load (node_modules/nuxi/dist/chunks/dev.mjs:6843:9) at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6873:5) at async _main (node_modules/nuxi/dist/cli.mjs:49:20)`

HapLifeMan commented 1 year ago

It looks like it's not an issue related to this module. Please be sure of what you said and if you think it is still related to this, please provide a reproduction link so I can check.

agracia-foticos commented 1 year ago

It looks like it's not an issue related to this module. Please be sure of what you said and if you think it is still related to this, please provide a reproduction link so I can check.

https://stackblitz.com/edit/nuxt-starter-rj4wcb

`ERROR Cannot start nuxt: Cannot read properties of undefined (reading 'addPlugin') 07:45:30

at trustboxModule (node_modules/nuxt-trustbox-module/lib/module.js:26:8) at Module.installModule (file://node_modules/@nuxt/kit/dist/index.mjs:520:21) at async initNuxt (file://node_modules/nuxt/dist/index.mjs:2484:7) at async load (file://node_modules/nuxi/dist/chunks/dev.mjs:6858:9) at async Object.invoke (file://node_modules/nuxi/dist/chunks/dev.mjs:6888:5) 07:45:29 at async _main (file://node_modules/nuxi/dist/cli.mjs:64:20) `