Open tangerball opened 5 months ago
const test = [ { test: 123, add: 123 }, { test: 123, add: 123 }, { test: 123, add: 123 }, { test: 123, add: 123 }, ] test.forEach((module, index) => { console.log('🚀 ~ test.forEach ~ module:', module) if (index == 1) { module.test = 123 } })
The above code example will have a packaging exception
Abnormal information: ERROR Duplicate export 'default' (Note that you need plugins to import files that are not JavaScript) 11:31:29 204: const CJSexport_default = (module.exports == null ? {} : module.exports).default || module.exports; 205: export { 206: CJS__export_default__ as default, ^ 207: } 208: / [vite-plugin-commonjs] export-statement-E /
Were you able to find a workaround for this issue?
Can you provide a minimal reproduction repo?
The above code example will have a packaging exception
Abnormal information: ERROR Duplicate export 'default' (Note that you need plugins to import files that are not JavaScript) 11:31:29
204: const CJSexport_default = (module.exports == null ? {} : module.exports).default || module.exports; 205: export { 206: CJS__export_default__ as default, ^ 207: } 208: / [vite-plugin-commonjs] export-statement-E /