primefaces / primevue-nuxt-module

MIT License
73 stars 11 forks source link

Build fails with default settings if 3rd party dependencies aren't installed #8

Closed deepfriedmind closed 1 year ago

deepfriedmind commented 1 year ago

When running the dev server with default settings, I get these messages:

Could not resolve id quill <path>/node_modules/.pnpm/primevue@3.37.0_vue@3.3.4/node_modules/primevue/editor/editor.esm.js?v=d38541b8
Could not resolve id chart.js/auto <path>/node_modules/.pnpm/primevue@3.37.0_vue@3.3.4/node_modules/primevue/chart/chart.esm.js?v=d38541b8

And if I try to build, I get this:

Details ``` ERROR [vite]: Rollup failed to resolve import "quill" from "/node_modules/.pnpm/primevue@3.37.0_vue@3.3.4/node_modules/primevue/editor/editor.esm.js". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to build.rollupOptions.external [6:10:26 PM] ERROR Nuxt Build Error: [vite]: Rollup failed to resolve import "quill" from "/node_modules/.pnpm/primevue@3.37.0_vue@3.3.4/node_modules/primevue/editor/editor.esm.js". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to build.rollupOptions.external This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to build.rollupOptions.external at viteWarn (node_modules/.pnpm/vite@4.4.9_@types+node@18.17.16/node_modules/vite/dist/node/chunks/dep-df561101.js:48142:27) at onRollupWarning (node_modules/.pnpm/vite@4.4.9_@types+node@18.17.16/node_modules/vite/dist/node/chunks/dep-df561101.js:48174:9) at onwarn (node_modules/.pnpm/vite@4.4.9_@types+node@18.17.16/node_modules/vite/dist/node/chunks/dep-df561101.js:47902:13) at node_modules/.pnpm/rollup@3.29.3/node_modules/rollup/dist/es/shared/node-entry.js:24271:13 at Object.logger [as onLog] (node_modules/.pnpm/rollup@3.29.3/node_modules/rollup/dist/es/shared/node-entry.js:25945:9) at ModuleLoader.handleInvalidResolvedId (node_modules/.pnpm/rollup@3.29.3/node_modules/rollup/dist/es/shared/node-entry.js:24857:26) at ModuleLoader.resolveDynamicImport (node_modules/.pnpm/rollup@3.29.3/node_modules/rollup/dist/es/shared/node-entry.js:24915:58) at async node_modules/.pnpm/rollup@3.29.3/node_modules/rollup/dist/es/shared/node-entry.js:24802:32  ELIFECYCLE  Command failed with exit code 1. ```

This makes sense since I don't have those packages installed and never will. I can of course exclude them, but I feel like options that require 3rd party dependencies should either need to be explicitly included in the settings or at least be mentioned in the docs that the default settings won't work without them.

Also, a question: would leaving the options at default, i.e. auto-importing everything, increase the bundle size or create any other potential performance issues?

mertsincan commented 1 year ago

Yes, for now, you can use exclude: ['Editor', 'Chart']. We'll discuss it and get back to you.

mertsincan commented 1 year ago

Hi, Thank you very much for the feedback, but we do not plan to work on this at the moment. You can use the exclude option.

primevue: {
   components: {
      exclude: ['Editor', 'Chart']
   }
}

Best Regards,

mertsincan commented 1 year ago

Hi,

Due to popular demand from users, we excluded the Chart and Editor components by default. Ref; https://github.com/primefaces/primevue-nuxt-module/issues/17

Best Regards,