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.

Declaration or statement expected "export type"

See original GitHub issue

https://github.com/pmndrs/jotai/blob/9bd3ea476d1a69f6f967a42a587c9bf8b0d16e41/src/index.ts#L4

import type/export type construct started being supported on TypeScript 3.8 and I just wanted to point that out because CRA still ships with 3.7.2 and this syntax won’t work if you don’t update TypeScript. It might be nice to add that on the documentation or use a different syntax for exporting types.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
italodeandracommented, Oct 23, 2020

Yeah, I didn’t mean to create a big of a deal with that, sorry. I’ll add the note and keep this issue as a reference. I’ll add the error to the title so people will find it when searching for it.

0reactions
dai-shicommented, Oct 23, 2020

When I was trying CRA before, I updated typescript, which wasn’t a big deal. (I’m not sure if that holds now, because CRA v3 had some issues with typescript+eslint even without jotai.)

Would you like to add some notes in ./docs/typescript.md? PR appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exporting a function on typescript "declaration or statement ...
It seems that let myfunction = something that returns a function export {myfunction};. will do the trick.
Read more >
Declaration or statement expected error in TypeScript
The "Declaration or statement expected" error occurs when we have a syntax error in our code, e.g. when destructuring, exporting, or have a...
Read more >
export type error · Issue #656 · umijs/dumi - GitHub
[error] src/index.ts: SyntaxError: Declaration or statement expected. (3:1) [error] 1 | export { default as Button } from '.
Read more >
Declaration or Statement Expected Error in TypeScript
Declaration or statement expected error also arises sometimes when exporting something that has been declared previously. Whenever this needed ...
Read more >
intermittent "TS1128: Declaration or statement expected" on ...
The embedded typescript and editor shows errors. No errors are reported when building externally. import React from 'react'; export ...
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