Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataCloneError on outExtension when DTS is on #667

Closed
zvictor opened this issue Jul 1, 2022 · 2 comments · May be fixed by #1235
Closed

DataCloneError on outExtension when DTS is on #667

zvictor opened this issue Jul 1, 2022 · 2 comments · May be fixed by #1235

Comments

@zvictor
Copy link
Contributor

zvictor commented Jul 1, 2022

While using the config file shown below, I get a DataCloneError whenever I turn dts on.

import { defineConfig } from 'tsup'

export default defineConfig({
  format: ['esm', 'cjs'],
  // dts: true,
  outExtension: ({ format }) => ({
    js: `.${format === 'esm' ? 'mjs' : format}`,
  }),
})

Error when dts is on:

DataCloneError: ({ format }) => ({
    js: `.${format === "esm" ? "mjs" : format}`
  }) could not be cloned.
    at new DOMException (node:internal/per_context/domexception:53:5)
    at Worker.postMessage (node:internal/worker:342:5)
    at ~/faugra/node_modules/.pnpm/tsup@6.1.2_typescript@4.7.4/node_modules/tsup/dist/index.js:2060:18
    at new Promise (<anonymous>)
    at dtsTask (~/faugra/node_modules/.pnpm/tsup@6.1.2_typescript@4.7.4/node_modules/tsup/dist/index.js:2058:15)
    at ~/faugra/node_modules/.pnpm/tsup@6.1.2_typescript@4.7.4/node_modules/tsup/dist/index.js:2171:24
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async build (~/faugra/node_modules/.pnpm/tsup@6.1.2_typescript@4.7.4/node_modules/tsup/dist/index.js:2046:3)
    at async CAC.<anonymous> (~/faugra/node_modules/.pnpm/tsup@6.1.2_typescript@4.7.4/node_modules/tsup/dist/chunk-HL6TILEC.js:185:5)

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@zvictor
Copy link
Contributor Author

zvictor commented Jul 1, 2022

Another thing disturbing me is the fact that after this error is thrown, the process keeps running forever.
I don't get an exit code, so my toThrow tests don't catch it at all.

@egoist
Copy link
Owner

egoist commented Jul 2, 2022

fixed in 6.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants