Open fernanduandrade opened 1 year ago
Same error! Have you found a solution?
Same error! Have you found a solution?
no solution yet, still searching
try adding these aliases:
// vite.config.ts/vite.config.js
resolve: {
alias: {
'primevue/config': 'primevue/config/config.cjs.js',
'primevue/api': 'primevue/api/api.cjs.js',
}
},
try adding these aliases:
// vite.config.ts/vite.config.js resolve: { alias: { 'primevue/config': 'primevue/config/config.cjs.js', 'primevue/api': 'primevue/api/api.cjs.js', } },
almost worked, but im facing a different problems now with the icons
This is the workaround I figured out for a working vite.config
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import resolve from "@rollup/plugin-node-resolve";
const customResolver = resolve({
extensions: [".esm.js", ".css", ".scss"]
});
export default defineConfig({
plugins: [
vue(),
],
ssgOptions: {
script: "async",
formatting: "prettify",
},
resolve: {
alias: [
{
find: "primevue",
customResolver: customResolver,
replacement: function(alias) {
return alias;
}
}
]
},
});
Describe the bug
Hello guys, I'm currently facing a problem where I installed primevue for my project and I'm unable to create the build when I run vite-ssg build it gives the following error bellow. Unfortunately I didn't find a similiar problem searching in forums and I also tried adding in my vite.config.ts in the ssrOptions the esm formart, but it didn't work. Does anyone has any ideia how could I solve this?
Reproduction
Add primevue in the vite project, when run the build with vite-ssg it thorws the error
System Info
Used Package Manager
npm
Validations