I'm trying to use pptxgenjs (version [3.12.0]) within a Quasar project that utilizes Vite for building. However, I'm encountering an error during the build process due to pptxgenjs's reliance on Node.js-style require statements (specifically for the https module).
Expected Behavior:
The Quasar/Vite build process should successfully bundle the project without errors.
Actual Behavior:
The build fails with an error message similar to:
Error: The plugin "vite:dep-pre-bundle" was triggered by this import
node_modules/pptxgenjs/dist/pptxgen.es.js:4883:90:
4883 │ ... require !== 'undefined' && typeof window === 'undefined' ? require('https') : null; // NodeJS
Error: Build failed with 1 error:
node_modules/vite/dist/node/chunks/dep-0a035c79.js:40970:10: ERROR: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "https". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "https". The package may have incorrect main/module/exports specified in its package.json.
I'm trying to use pptxgenjs (version [3.12.0]) within a Quasar project that utilizes Vite for building. However, I'm encountering an error during the build process due to pptxgenjs's reliance on Node.js-style require statements (specifically for the https module).
Expected Behavior: The Quasar/Vite build process should successfully bundle the project without errors.
Actual Behavior: The build fails with an error message similar to: Error: The plugin "vite:dep-pre-bundle" was triggered by this import node_modules/pptxgenjs/dist/pptxgen.es.js:4883:90: 4883 │ ... require !== 'undefined' && typeof window === 'undefined' ? require('https') : null; // NodeJS Error: Build failed with 1 error: node_modules/vite/dist/node/chunks/dep-0a035c79.js:40970:10: ERROR: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "https". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "https". The package may have incorrect main/module/exports specified in its package.json.
Additional Information: @quasar/app-vite: 1.3.0 vue: 3.0.0 quasar: 2.6.0
Request:
Thank you for your time and assistance.