docs/plans/4889-csv-papaparse-vitest.md
Fix @platejs/csv so native ESM consumers like Vitest do not crash on papaparse CJS interop.
#4889@platejs/csv breaks Vitest due to CJS/ESM interop issue with papaparse@platejs/csv papaparse imports and nearby tests/patterns.docs/solutions/ for relevant learnings.@platejs/csv/dist/index.js contains import { parse } from "papaparse";.papaparse is CommonJS.node --input-type=module -e "import('packages/csv/dist/index.js')" before the fix.papaparse shape bug in deserializeCsv, so this fix stayed in the same module and added package-surface coverage.process.execPath inside Bun tests points at Bun, not Node. The regression test must invoke node explicitly.bun test packages/csv/src/lib/esmInterop.spec.ts after the build: passbun test packages/csv/src/lib/deserializer/utils/deserializeCsv.spec.ts packages/csv/src/lib/CsvPlugin.spec.ts: passbun test packages/csv/src/lib/esmInterop.spec.ts packages/csv/src/lib/deserializer/utils/deserializeCsv.spec.ts packages/csv/src/lib/CsvPlugin.spec.ts: passpnpm install: passpnpm turbo build --filter=./packages/csv: passpnpm turbo typecheck --filter=./packages/csv: passpnpm exec biome check packages/csv/src/lib/esmInterop.spec.ts packages/csv/src/lib/deserializer/utils/deserializeCsv.ts packages/csv/src/lib/deserializer/utils/deserializeCsv.spec.ts packages/csv/src/lib/CsvPlugin.spec.ts: passpnpm lint:fix: failed on unrelated .codex/skills/claude-permissions-optimizer/scripts/extract-commands.mjs lint errors