Skip to content

Commit d346324

Browse files
fix: next.js build issue
1 parent da105b1 commit d346324

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

examples/full/lib/preview-images.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import got from 'got'
1+
import ky from 'ky'
22
import lqip from 'lqip-modern'
33
import {
44
type ExtendedRecordMap,
@@ -34,7 +34,7 @@ export async function getPreviewImageMap(
3434

3535
async function createPreviewImage(url: string): Promise<PreviewImage | null> {
3636
try {
37-
const { body } = await got(url, { responseType: 'buffer' })
37+
const body = await ky(url).arrayBuffer()
3838
const result = await lqip(body)
3939
console.log('lqip', { originalUrl: url, ...result.metadata })
4040

packages/react-notion-x/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
"exports": {
1414
".": {
1515
"types": "./build/index.d.ts",
16-
"import": "./build/index.js"
16+
"default": "./build/index.js"
1717
},
1818
"./build/third-party/code": {
1919
"types": "./build/third-party/code.d.ts",
20-
"import": "./build/third-party/code.js"
20+
"default": "./build/third-party/code.js"
2121
},
2222
"./build/third-party/collection": {
2323
"types": "./build/third-party/collection.d.ts",
24-
"import": "./build/third-party/collection.js"
24+
"default": "./build/third-party/collection.js"
2525
},
2626
"./build/third-party/equation": {
2727
"types": "./build/third-party/equation.d.ts",
28-
"import": "./build/third-party/equation.js"
28+
"default": "./build/third-party/equation.js"
2929
},
3030
"./build/third-party/modal": {
3131
"types": "./build/third-party/modal.d.ts",
32-
"import": "./build/third-party/modal.js"
32+
"default": "./build/third-party/modal.js"
3333
},
3434
"./build/third-party/pdf": {
3535
"types": "./build/third-party/pdf.d.ts",
36-
"import": "./build/third-party/pdf.js"
36+
"default": "./build/third-party/pdf.js"
3737
},
3838
"./styles.css": "./src/styles.css",
3939
"./src/styles.css": "./src/styles.css"

packages/react-notion-x/src/third-party/collection-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function getCollectionGroups(
77
...rest: any[]
88
): any[] {
99
const elems = collectionView?.format?.collection_groups || []
10-
return elems?.map(({ property, hidden, value: { value, type } }: any) => {
10+
return elems.map(({ property, hidden, value: { value, type } }: any) => {
1111
const isUncategorizedValue = value === undefined
1212
const isDateValue = value?.range
1313
// TODO: review dates reducers

packages/react-notion-x/tsup.config.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineConfig } from 'tsup'
22

33
export default defineConfig({
44
entry: [
5-
'src/index.tsx',
5+
'src/index.ts',
66
'src/third-party/code.tsx',
77
'src/third-party/collection.tsx',
88
'src/third-party/equation.tsx',
@@ -17,6 +17,5 @@ export default defineConfig({
1717
shims: false,
1818
dts: true,
1919
minify: false,
20-
sourcemap: true,
21-
external: ['react', 'react-dom']
20+
sourcemap: true
2221
})

0 commit comments

Comments
 (0)