rusackas commented on PR #40109:
URL: https://github.com/apache/superset/pull/40109#issuecomment-4484392040

   @Copilot good catch — you were right. I initially misanalyzed this thinking 
esModuleInterop would synthesize the default import from the module namespace, 
but v2's compiled output sets `__esModule: true` with named exports only and no 
`module.exports = ...` fallback. With `__esModule: true` present, the `import 
contentDisposition from 'content-disposition'` form resolves to 
`module.default` → `undefined` at runtime in production webpack output, so 
`contentDisposition.parse(...)` would throw whenever the consumer code actually 
runs.
   
   The unit tests pass(ed) because the test mock supplied `{ default: mockFn, 
__esModule: true }` — papering over the missing default. There's no e2e test 
exercising real file downloads in CI, so the runtime crash wouldn't surface.
   
   Pushed a follow-up commit that switches to named imports in the 3 consumer 
files (`src/utils/export.ts`, 
`src/dashboard/components/menu/DownloadMenuItems/index.tsx`, 
`src/dashboard/hooks/useDownloadScreenshot.ts`) and simplifies the test mock to 
the same shape.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to