react-notion-x icon indicating copy to clipboard operation
react-notion-x copied to clipboard

NotionCompatAPI missing declaration file

Open pnodet opened this issue 2 years ago • 1 comments
trafficstars

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.

pnodet avatar Jul 21 '23 17:07 pnodet

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

janek avatar Mar 25 '24 12:03 janek