primefaces / primevue-nuxt-module

MIT License
73 stars 11 forks source link

Error on cloudflare pages deployment #13

Closed cristiancosano closed 1 year ago

cristiancosano commented 1 year ago

After migrating from a custom Nuxt plugin to the PrimeVue Nuxt Module, I encountered an error when deploying my application on Cloudflare Pages.

In Cloudflare's logs, I received the following error message:

image

The build process was successful, but the error occurred when Cloudflare attempted to deploy the application to its global network.

View the complete Cloudflare log here: cloudflare.log

I'm sure this issue is caused by using the module because it works correctly with the Nuxt plugin, and when I deactivate the module during deployment on Cloudflare, there are no errors. The error only occurs on Cloudflare. If I build the project locally (node preset), I don't receive any errors.

mertsincan commented 1 year ago

This is interesting! We don't use any document object. We only register the components like in the nuxt-plugin. I think this is related to cloudflare + nitro. Nuxt-primevue module uses a custom nitro plugin to append the styles of components to html.head. This may have caused the problem. Could you please try to set cloudflare or cloudflare_pages preset in nuxt.config.js?

// nuxt.config.js
...
nitro: {
     preset: 'cloudflare'
}
...

Refs; https://nitro.unjs.io/config#preset https://nitro.unjs.io/deploy/providers/cloudflare

mertsincan commented 1 year ago

Hi,

For now, closed. If there is any update from your side, please reopen it. Thanks a lot for your understanding!

Best Regards,