Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NPM package has types (*.d.ts) in incorrect location #13886

Open
BobbyL2k opened this issue May 8, 2024 · 0 comments
Open

[BUG] NPM package has types (*.d.ts) in incorrect location #13886

BobbyL2k opened this issue May 8, 2024 · 0 comments
Labels

Comments

@BobbyL2k
Copy link

BobbyL2k commented May 8, 2024

Software versions

BokehJS version: broken since 3.1.0 to current version 3.4.1

Browser name and version

Jupyter notebook / Jupyter Lab version

Expected behavior

Import Bokeh in TypeScript should work when installing

npm install @bokeh/bokehjs

import * as Bokeh from '@bokeh/bokehjs';

TypeScript should not complain about type information being missing.

node_modules/@bokeh/bokehjs/package.json expect types information under build/js/types (see

"types": "build/js/types/bokeh.d.ts",
)

However the pre-compiled files under build/js do not match this layout.
Types are located under build/js/lib instead of build/js/types.

This is easily verifiable by going to NPM package registry and see how there is no types directory

https://www.npmjs.com/package/@bokeh/bokehjs?activeTab=code

Screenshot 2567-05-08 at 23 31 37

Observed behavior

Could not find a declaration file for module '@bokeh/bokehjs'. '/path/to/project/node_modules/@bokeh/bokehjs/build/js/lib/bokeh.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/bokeh__bokehjs` if it exists or add a new declaration (.d.ts) file containing `declare module '@bokeh/bokehjs';`
```

### Example code

```typescript
import * as Bokeh from '@bokeh/bokehjs';
```


### Stack traceback or browser console output

_No response_

### Screenshots

_No response_
@BobbyL2k BobbyL2k added the TRIAGE label May 8, 2024
@BobbyL2k BobbyL2k changed the title [BUG] NPM package has types (*.d.ts) at the incorrect location [BUG] NPM package has types (*.d.ts) in incorrect location May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant