NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.69k stars 544 forks source link

NotionCompatAPI missing declaration file #510

Open pnodet opened 1 year ago

pnodet commented 1 year ago

Hi!

When using the NotionCompatAPI from 'notion-compat' currently version "6.16.0" the declaration file is not emitted or present in the dist folder.

janek commented 4 months ago

I'm having the same problem, or at least so I think:

Type error: Could not find a declaration file for module 'notion-compat'. '/vercel/path0/node_modules/notion-compat/build/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/notion-compat` if it exists or add a new declaration (.d.ts) file containing `declare module 'notion-compat';`
  2 | import * as React from "react"
  3 | import NotionPage from "../ui/notion-page"
> 4 | import { NotionCompatAPI } from "notion-compat"
    |                                 ^
  5 | import getProjectsFromNotion from "../lib/getProjectsFromNotion"
  6 |
  7 | // Next.js setting: Give a 404 for any slug that's not on the generateStaticParams() list
error: script "build" exited with code 1
Error: Command "bun run build" exited with 1

Workaround that worked for me:

Screenshot 2024-03-25 at 13 58 02