question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type definitions missing

See original GitHub issue

When I try to import the package in my Svelte project, I get the following error:

Could not find a declaration file for module 'svelte-portal'.
'node_modules/svelte-portal/src/main.cjs.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/svelte-portal` if it exists or add a new declaration (.d.ts) file containing `declare module 'svelte-portal';`

Looking at the svelte-portal folder in node_modules, there indeed isn’t any .d.ts file.

This is weird, sveltekit package should produce both a compiled .svelte file as well as .d.ts file. (For comparison, projects like svelte-material-ui do ship the .d.ts files, and therefore work out-of-the-box.) Could you, by any chance, publish the package with the type definitions?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
romkorcommented, May 18, 2022

Did you try import Portal from “svelte-portal/src/Portal.svelte”?

0reactions
romkorcommented, Jun 2, 2022

Thanks, merged!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to include missing type definition files in typescript ...
I would suggest switching to types from typeRoots and using an include pattern rather than files . { "compilerOptions": { "lib": ["dom" ...
Read more >
How to Declare Missing Types for External Libraries -- newline
If DefinitelyTyped doesn't have type declarations for a library you can declare types yourself.
Read more >
Typescript type definitions missing in 1.7.0 · Issue #32 - GitHub
We just went to upgrade to the latest version (1.7.0) and noticed that the type definitions were missing from the package.
Read more >
Missing type definitions - IBM
Missing type definitions. DCM includes all user-defined type definitions in transfer packages. During a receive operation, DCM automatically creates ...
Read more >
Missing type definition (typescript) - Handsontable Forum
Hi, We have upgraded to the latest version (11.1.0) and are experiencing missing type definitions for the samplingRatio and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found