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 paths are incorrect

See original GitHub issue

When installing @operational/components into a new project, the typings files contain incorrect import paths when requiring dependant interfaces, missing an additional ../. This causes typescript compilation to fail on projects depending on this package.

E.g. node_modules/@operational/components/lib/Icon/Icon.d.ts will contain this line:

declare const _default: import("../../../../node_modules/create-emotion-styled/types/react.d.ts").StyledOtherComponent<{}, import("../../../../node_modules/emotion-theming/types/index.d.ts").OptionalThemeProps<PropsWithTheme, {}>, any>;

Imports should instead start with ../../../../../node_modules.

Looks like the error crept in after introducing the new build + babel plugin, though I do not have a clear idea on what exactly about it caused the issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
TejasQcommented, Jul 11, 2018

#579 to the rescue!

1reaction
peterszerzocommented, Jul 10, 2018

@TejasQ the issue persists, I’m getting the same .d.ts file as I copied in earlier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect path to type definitions #1148 - imbhargav5/rooks
I got an error about the path to the type definitions being unresolvable. I'm using Yarn 1.22 with a Next.js project.
Read more >
typescript - typings has wrong referenced path - Stack Overflow
When the index.d.ts is generated inside the dist folder, it has the wrong referenced path to the typings. import { CoolData } from...
Read more >
API - esbuild
Bundling with esbuild only works with statically-defined imports (i.e. when the import path is a string literal). Imports that are defined at run-time...
Read more >
Typescript — How to solve the problem with unresolved path ...
Generally, what should be done can be summarized as follows: Take a look into tsconfig.json and check if there are path aliases defined...
Read more >
File path formats on Windows systems | Microsoft Learn
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
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