From 1f4a8d31c8af5e6a6454c08e34a50430caa40fc6 Mon Sep 17 00:00:00 2001 From: zbeyens Date: Tue, 10 Oct 2023 20:14:01 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/forty-apes-teach.md | 5 +++++ packages/serializer-csv/src/deserializer/types.ts | 2 +- .../serializer-csv/src/deserializer/utils/deserializeCsv.ts | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/forty-apes-teach.md diff --git a/.changeset/forty-apes-teach.md b/.changeset/forty-apes-teach.md new file mode 100644 index 0000000000..715d6a84f7 --- /dev/null +++ b/.changeset/forty-apes-teach.md @@ -0,0 +1,5 @@ +--- +'@udecode/plate-serializer-csv': patch +--- + +Fix: Named export 'parse' not found. diff --git a/packages/serializer-csv/src/deserializer/types.ts b/packages/serializer-csv/src/deserializer/types.ts index ca48ac064c..75a319845d 100644 --- a/packages/serializer-csv/src/deserializer/types.ts +++ b/packages/serializer-csv/src/deserializer/types.ts @@ -1,4 +1,4 @@ -import { ParseConfig } from 'papaparse'; +import type { ParseConfig } from 'papaparse'; export type DeserializeCsvParseOptions = ParseConfig; diff --git a/packages/serializer-csv/src/deserializer/utils/deserializeCsv.ts b/packages/serializer-csv/src/deserializer/utils/deserializeCsv.ts index 13e66e6d27..509e363c0e 100644 --- a/packages/serializer-csv/src/deserializer/utils/deserializeCsv.ts +++ b/packages/serializer-csv/src/deserializer/utils/deserializeCsv.ts @@ -14,11 +14,13 @@ import { ELEMENT_TH, ELEMENT_TR, } from '@udecode/plate-table'; -import { parse } from 'papaparse'; +import papaparse from 'papaparse'; import { KEY_DESERIALIZE_CSV } from '../createDeserializeCsvPlugin'; import { DeserializeCsvParseOptions, DeserializeCsvPlugin } from '../types'; +const { parse } = papaparse; + const isValidCsv = ( data: Record[][], errors: Record[][],