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.

TypeScript typings do not export <Root>

See original GitHub issue

Are you reporting a bug?

Yes.

I’m trying to upgrade a project to v6, and one of the first things I’m running into is that I want to import { Root} from 'react-static', but TypeScript tells me

Module ‘“react-static”’ has no exported member ‘Root’. (2305)

Which is correct: I don’t see Root being exported from index.d.ts.

Environment

  1. react-static -V: 6.0.9
  2. node -v: v10.14.1
  3. npm -v: 6.4.1
  4. yarn -v (I use Yarn): 1.12.3
  5. Operating system: Ubuntu 18.04.1 LTS

Steps to Reproduce the problem

Base your steps off of any freshly installed react-static template!

I can’t really provide the steps from a basic template yet as I have yet to write a plugin for TypeScript, but basically, the line import { Root, Routes } from 'react-static' that is in the freshly-installed template will not work if TypeScript were to be enabled.

Expected Behavior

The TypeScript typings to be up-to-date with v6.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Vinnlcommented, Dec 22, 2018

Yes, I hope to look at it over the holidays. I take it the typings as a whole then are not updated for v6?

Btw, if it’s not officially supported, it might be worthwhile to consider moving the typings to DefinitelyTyped? That’s usually a sign that they’re more likely to be lagging behind the official project compared to when the project itself hosts them. But for now I’ll submit them here if I get around to it 😃

0reactions
Vinnlcommented, Dec 22, 2018

@bernatfortet I just found out that there was already PR #891 that adds exactly that 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript typings have no default export · Issue #533
In version 6.2.1 the tsc compiler complains that 'react-day-picker' has no default export. ... // **\node_modules\react-day-picker\types\index.d.
Read more >
TypeScript. How to use not exported type definitions?
I found this problem when I tried import .d.ts file of JS lib and I don't have ability to export needed interface. Can...
Read more >
Documentation - Modules .d.ts - TypeScript
For example, here is a module which exports a function and a numerical constant: ... You may want to provide a type for...
Read more >
Avoid Export Default - TypeScript Deep Dive
Re-exporting is common for the root index file in npm packages, and forces you to name the default export manually e.g. export {...
Read more >
TypeScript library tips: Rollup your types! | by Martin Hochel
As a not very known technique apply this pattern also on your ambient types definitions, that are generated by TypeScript compiler ...
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