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

Bundled types fail to load #70

Open
tpluscode opened this issue Nov 19, 2021 · 1 comment
Open

Bundled types fail to load #70

tpluscode opened this issue Nov 19, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@tpluscode
Copy link

tpluscode commented Nov 19, 2021

📖 Reproduction steps

Add any of the below lines to a TS module:

  • import * as mwcComponents from '@hydrofoil/shaperone-wc-material/components'
  • import * as mwcComponents from '@hydrofoil/shaperone-wc-material/components.js'
  • import * as MaterialRenderStrategy from '@hydrofoil/shaperone-wc-material/renderer'
  1. Save

They are all existing modules and resolve fine

🙁 Current Behavior

The import gets highlighted with errors like Cannot find module '@hydrofoil/shaperone-wc-material/components' or its corresponding type declarations.

wcd tries to dereference https://srv.divriots.com/typings/@hydrofoil/[email protected]/components?typings which fails because it looks for @types/* package

Command failed: /app/node_modules/.bin/npm install --no-audit --no-fund --production=false npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fhydrofoil__shaperone-wc-material - Not found npm ERR! 404 npm ERR! 404 '@types/hydrofoil__shaperone-wc-material@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 It was specified as a dependency of '9dca6c0588e5088f5162d4921d11d1b02185d963' npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! /home/.npm/_logs/2021-11-19T14_57_46_040Z-debug.log

🙂 Expected Behavior

Bundled types should be loaded as seen in https://unpkg.com/browse/@hydrofoil/[email protected]/components.d.ts

🔗 Link to the component

No response

🌐 What browser(s) are you seeing the problem on?

Chrome

Browser version(s)

No response

@tpluscode tpluscode added the bug Something isn't working label Nov 19, 2021
@gluck
Copy link
Member

gluck commented Nov 19, 2021

This package is missing types declaration in package.json as per https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package

We could infer typings from <main>.d.ts though, not sure if vscode/typescript are supporting that (doc says no, but implementation may differ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants