esm.sh
esm.sh copied to clipboard
Failed to import - ink (types)
Failing module
- GitHub: https://github.com/vadimdemedes/ink
- npm: https://www.npmjs.com/package/ink
// test.ts
import * as i from 'https://esm.sh/ink';
Error message
After running deno run --unstable test.ts I get this:
Download https://cdn.esm.shchalk/
Download https://cdn.esm.shcli-boxes/
Check file:///path/to/test.ts
error: TS2300 [ERROR]: Duplicate identifier 'Buffer'.
var Buffer: typeof bufferModule;
~~~~~~
at https://deno.land/[email protected]/node/global.ts:25:7
'Buffer' was also declared here.
declare class Buffer extends Uint8Array {
~~~~~~
at https://cdn.esm.sh/v58/node.ns.d.ts:16:15
TS2300 [ERROR]: Duplicate identifier 'Buffer'.
type Buffer = bufferModule;
~~~~~~
at https://deno.land/[email protected]/node/global.ts:26:8
'Buffer' was also declared here.
declare class Buffer extends Uint8Array {
~~~~~~
at https://cdn.esm.sh/v58/node.ns.d.ts:16:15
TS2300 [ERROR]: Duplicate identifier 'Buffer'.
declare class Buffer extends Uint8Array {
~~~~~~
at https://cdn.esm.sh/v58/node.ns.d.ts:16:15
'Buffer' was also declared here.
var Buffer: typeof bufferModule;
~~~~~~
at https://deno.land/[email protected]/node/global.ts:25:7 and here.
type Buffer = bufferModule;
~~~~~~
at https://deno.land/[email protected]/node/global.ts:26:8
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
stdout: NodeJS.WriteStream;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/ink.d.ts:4:20
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'ReadStream'.
stdin: NodeJS.ReadStream;
~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/ink.d.ts:5:19
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
stderr: NodeJS.WriteStream;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/ink.d.ts:6:20
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
stdout?: NodeJS.WriteStream;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/render.d.ts:10:21
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'ReadStream'.
stdin?: NodeJS.ReadStream;
~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/render.d.ts:16:20
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
stderr?: NodeJS.WriteStream;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/render.d.ts:21:21
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
declare type RenderFunction = <Props, K extends NodeJS.WriteStream | RenderOptions>(tree: ReactElement<Props>, options?: K) => Instance;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/render.d.ts:60:56
TS2305 [ERROR]: Module '"deno:///missing_dependency.d.ts"' has no exported member 'Boxes'.
import { Boxes } from 'https://cdn.esm.shcli-boxes';
~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/styles.d.ts:2:10
TS2305 [ERROR]: Module '"deno:///missing_dependency.d.ts"' has no exported member 'ForegroundColor'.
import { ForegroundColor } from 'https://cdn.esm.shchalk';
~~~~~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/styles.d.ts:4:10
TS2305 [ERROR]: Module '"deno:///missing_dependency.d.ts"' has no exported member 'ForegroundColor'.
import { ForegroundColor } from 'https://cdn.esm.shchalk';
~~~~~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/components/Text.d.ts:2:10
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'ReadStream'.
readonly stdin?: NodeJS.ReadStream;
~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/components/StdinContext.d.ts:7:29
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
readonly stdout?: NodeJS.WriteStream;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/components/StdoutContext.d.ts:7:30
TS2694 [ERROR]: Namespace 'NodeJS' has no exported member 'WriteStream'.
readonly stderr?: NodeJS.WriteStream;
~~~~~~~~~~~
at https://cdn.esm.sh/v58/[email protected]/build/components/StderrContext.d.ts:7:30
Found 16 errors.
Additional info
- esm.sh version: v58
- Deno version: 1.17.2
The Download https://cdn.esm.shchalk/ and Download https://cdn.esm.shcli-boxes/ lines seem very broken. If I do deno info test.ts, this is what I get:
Download https://cdn.esm.shchalk/
Download https://cdn.esm.shcli-boxes/
local: /home/dmercer/lucid/dans-tools/deno/temp-test.ts
emit: /home/dmercer/.cache/deno/gen/file/home/dmercer/lucid/dans-tools/deno/temp-test.ts.js
type: TypeScript
dependencies: 277 unique (total 3.32MB)
file:///home/dmercer/lucid/dans-tools/deno/temp-test.ts (40B)
└─┬ https://esm.sh/ink (159B)
├─┬ https://cdn.esm.sh/v58/[email protected]/build/index.d.ts (1.37KB)
│ ├─┬ https://cdn.esm.sh/v58/[email protected]/build/components/AppContext.d.ts (445B)
│ │ └─┬ https://cdn.esm.sh/v58/@types/[email protected]/index.d.ts (148.67KB)
│ │ ├── https://cdn.esm.sh/v58/@types/[email protected]/global.d.ts (7.01KB)
│ │ ├── https://cdn.esm.sh/v58/@types/[email protected]/index.d.ts (3.58KB)
│ │ ├── https://cdn.esm.sh/v58/@types/[email protected]/tracing.d.ts (4.03KB)
│ │ └── https://cdn.esm.sh/v58/[email protected]/index.d.ts (844.54KB)
│ ├─┬ https://cdn.esm.sh/v58/[email protected]/build/components/Box.d.ts (2.9KB)
│ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/build/dom.d.ts (1.93KB)
│ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/build/render-node-to-output.d.ts (384B)
│ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/build/dom.d.ts *
│ │ │ │ └─┬ https://cdn.esm.sh/v58/[email protected]/build/output.d.ts (761B)
│ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/build/render-node-to-output.d.ts *
│ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/build/styles.d.ts (4.1KB)
│ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/index.d.ts (1.27KB)
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/async-return-type.d.ts (724B)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/promise-value.d.ts (637B)
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/basic.d.ts (2.04KB)
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/conditional-except.d.ts (1022B)
│ │ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/conditional-keys.d.ts (1.17KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/except.d.ts (886B)
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/conditional-keys.d.ts *
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/conditional-pick.d.ts (938B)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/conditional-keys.d.ts *
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/except.d.ts *
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/literal-union.d.ts (1.13KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/basic.d.ts *
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/merge-exclusive.d.ts (1.31KB)
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/merge.d.ts (420B)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/except.d.ts *
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/mutable.d.ts (860B)
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/opaque.d.ts (2.61KB)
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/package-json.d.ts (12.73KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/index.d.ts *
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/partial-deep.d.ts (2.26KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/basic.d.ts *
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/promisable.d.ts (775B)
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/promise-value.d.ts *
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/readonly-deep.d.ts (1.79KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/basic.d.ts *
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/require-at-least-one.d.ts (814B)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/except.d.ts *
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/require-exactly-one.d.ts (1.23KB)
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/set-optional.d.ts (1.05KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/except.d.ts *
│ │ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/source/set-required.d.ts (1.05KB)
│ │ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/except.d.ts *
│ │ │ │ │ ├── https://cdn.esm.sh/v58/[email protected]/source/tsconfig-json.d.ts (16.45KB)
│ │ │ │ │ └── https://cdn.esm.sh/v58/[email protected]/source/union-to-intersection.d.ts (1.91KB)
│ │ │ │ ├─┬ https://cdn.esm.sh/v58/[email protected]/index.d.ts (100B)
│ │ │ │ │ └── https://cdn.esm.sh/v58/@types/[email protected]/index.d.ts (14.72KB)
│ │ │ │ ├── https://cdn.esm.shchalk/ (loading error)
│ │ │ │ └── https://cdn.esm.shcli-boxes/ (loading error)
│ │ │ ├── https://cdn.esm.sh/v58/@types/[email protected]/index.d.ts *
│ │ │ └── https://cdn.esm.sh/v58/[email protected]/index.d.ts *
│ │ ├── https://cdn.esm.sh/v58/[email protected]/build/styles.d.ts *
...
The problem seems to happen in https://cdn.esm.sh/v58/[email protected]/build/styles.d.ts:
$ curl -s https://cdn.esm.sh/v58/[email protected]/build/styles.d.ts | less | head
import { YogaNode } from 'https://cdn.esm.sh/v58/[email protected]/index.d.ts';
import { Boxes } from 'https://cdn.esm.shcli-boxes';
import { LiteralUnion } from 'https://cdn.esm.sh/v58/[email protected]/index.d.ts';
import { ForegroundColor } from 'https://cdn.esm.shchalk';
export interface Styles {
readonly textWrap?: 'wrap' | 'end' | 'middle' | 'truncate-end' | 'truncate' | 'truncate-middle' | 'truncate-start';
readonly position?: 'absolute' | 'relative';
/**
* Top margin.
*/
latest version is v61
but it still fails to build due to this:
➜ deno eval --unstable "import * as i from 'https://esm.sh/ink?pin=v61'"
Download https://cdn.esm.shchalk/
Download https://cdn.esm.shcli-boxes/
This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
error: Uncaught ReferenceError: _a is not defined
at https://cdn.esm.sh/v61/[email protected]/deno/yoga-layout-prebuilt.js:3:58800
at https://cdn.esm.sh/v61/[email protected]/deno/yoga-layout-prebuilt.js:3:77999
at https://cdn.esm.sh/v61/[email protected]/deno/yoga-layout-prebuilt.js:4:508
at https://cdn.esm.sh/v61/[email protected]/deno/yoga-layout-prebuilt.js:2:681
at https://cdn.esm.sh/v61/[email protected]/deno/yoga-layout-prebuilt.js:4:713
@talentlessguy Thanks for the tip about the version. If you add --ext ts to your command to make it do type checking, you'll see the type errors still happen:
$ deno eval --unstable --ext ts "import * as i from 'https://esm.sh/ink?pin=v61'"
Download https://cdn.esm.shchalk/
Download https://cdn.esm.shcli-boxes/
error: TS2300 [ERROR]: Duplicate identifier 'Buffer'.
var Buffer: typeof bufferModule;
~~~~~~
at https://deno.land/[email protected]/node/global.ts:25:7
'Buffer' was also declared here.
declare class Buffer extends Uint8Array {
~~~~~~
at https://cdn.esm.sh/v61/node.ns.d.ts:16:15
... etc.