denoland / denoland/dnt

Unexpected type errors

Open
#355 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
1.3k
Forks
49
PR merge metrics
No merged PRs in 30d

Description

I am working on [RFUI](https://github.com/adamzerner/rfui) which is a component library intended to be available to React and Preact projects. Right now I'm using Preact, but eventually I want to figure out how to get it working for React as well.

Anyway, right now I want to publish to NPM. I followed the instructions in the ["Setup" section](https://github.com/denoland/dnt#setup), but I get a bunch of type errors. I've got [this](https://github.com/adamzerner/rfui/blob/master/scripts/build-npm.ts) `build-npm.ts` script. When I run it, I get the following output (full output: [output.txt](https://github.com/denoland/dnt/files/13695471/output.txt)):

```
code/rfui [master●] » deno run -A scripts/build-npm.ts 0.0.12
[dnt] Transforming...
[dnt] Running npm install...

added 3 packages, and audited 4 packages in 293ms

found 0 vulnerabilities
[dnt] Building project...
[dnt] Type checking ESM...
src/components/atoms/badge.tsx:1:37 - error TS2307: Cannot find module 'preact' or its corresponding type declarations.

1 import { ComponentChild, JSX } from "preact";
~~~~~~~~
src/components/atoms/badge.tsx:8:29 - error TS2304: Cannot find name 'HTMLDivElement'.

8 } & Omit, "size">;
~~~~~~~~~~~~~~
src/components/atoms/badge.tsx:8:29 - error TS4081: Exported type alias 'BadgeType' has or is using private name 'HTMLDivElement'.

8 } & Omit, "size">;
~~~~~~~~~~~~~~
src/components/atoms/badge.tsx:72:5 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.

72


~~~~~
src/components/atoms/badge.tsx:72:6 - error TS2304: Cannot find name 'React'.

72

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.