primefaces / primevue-nuxt-module

MIT License
70 stars 11 forks source link

Remove `prefix` option from `composables` #35

Closed jg-jgriffith closed 8 months ago

jg-jgriffith commented 8 months ago

Nuxt-Primevue version: 0.2.1

I was looking to use the new importPt functionality however upgrading the module to 0.2.1 completely broke everything. Here's a trimmed down version of what I was using the worked prior:

  primevue: {
    // importPT: { as: 'PrimePassthrough', from: 'primevue/passthrough/tailwind'},
    options: {
      unstyled: true,
      pt: {
        datatable: {
          table: {
            class: ['table table-zebra'],
          },
        },
      },
    },
    components: {
      prefix: 'Prime',
      include: ['InputMask', 'DataTable', 'Column', 'ProgressBar', 'Toast'],
    },
    directives: {
      prefix: 'prime',
      exclude: ['*'],
    },
    composables: {
      prefix: 'prime',
      exclude: ['*'],
    },
  },

There is no error on the page, only a white screen. However in console I do manage to get a single error: primevue-plugin.mjs:1

Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/primevue@3.42.0_vue@3.3.9/node_modules/primevue/config/config.esm.js?v=86a72178' does not provide an export named 'primeusePrimeVue' (at primevue-plugin.mjs:1:10)

Update: Confirmed reverting to 0.2.0 fixes the issue.

mertsincan commented 8 months ago

Hi, Thanks a lot for your report. Currently, composables cannot be given a different name in Nuxt. When they provide this, I will add the prefix option again. https://nuxt.com/docs/guide/going-further/modules#injecting-composables-with-addimports-and-addimportsdir

Best Regards,

mertsincan commented 8 months ago

Good news, I released the v0.2.2 for you. Could you please try it without composables.prefix?

Best Regards,