Static site generation with Vue causes SyntaxError: Cannot use import statement outside a module #1153
-
Has anybody already integrate PrimeVue (https://primevue.org) with Vike for SSG? My app works works great on "npm run dev", but for "npm run build" it causes For example, when I try to generate page containing Button:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
It's a classic CJS/ESM issue and there are usually multiple ways to work around it. Create a minimal reproduction (that doesn't use pre-rendering) and I'll dig into it. |
Beta Was this translation helpful? Give feedback.
-
I will prepare it! Thank you so much.
In the meanwhile: how it is even possible that the same code is behaving differently on npm run and build?
|
Beta Was this translation helpful? Give feedback.
-
Here you go https:/mattwarrick/vike-primevue. Specifically, have a look if I add PrimeVue correctly. Thank you so much! |
Beta Was this translation helpful? Give feedback.
Improved reproduction: https:/brillout/vike-primevue.
The workaround is this.