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 error when importing into a React Project

See original GitHub issue

Has anyone experienced this before? I’m running Typescript 3.9 and getting “import type” errors

C:/Users/asiqueira/dev/Portfolio React/Projeto/web/node_modules/react-tsparticles/index.d.ts
TypeScript error in C:/Users/asiqueira/dev/Portfolio React/Projeto/web/node_modules/react-tsparticles/index.d.ts(9,13):
'=' expected.  TS1005

    7 | import { ComponentClass } from "react";
    8 | import { Container } from "tsparticles/dist/Core/Container";
 >  9 | import type { IOptions } from "tsparticles/dist/Options/Interfaces/IOptions";
      |             ^
   10 | import type { RecursivePartial } from "tsparticles/dist/Types/RecursivePartial";
   11 | import { IPolygonMaskOptions } from "tsparticles/dist/Plugins/PolygonMask/PolygonMaskPlugin";
   12 | import { IAbsorberOptions } from "tsparticles/dist/Plugins/Absorbers/AbsorbersPlugin";

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
matteobrunicommented, Aug 22, 2020

Hi @atesija,

You need to update your TypeScript package to latest version

3reactions
alansiqcommented, Jun 24, 2020

Matteo, thank you for your quick and helpful responses! It must’ve been a hookie mistake on my side. I’m not sure what fixed it, but it’s now fixed.

If I find out what I was doing wrong I’ll let you know for future evidence, but right now I don’t know what I did.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I have to use import * as React from "react" in typescript ...
reactjs - I have to use import * as React from "react" in typescript, otherwise can't recognize the 'react' package of nodemodules -...
Read more >
Cannot use import statement outside a module [React ...
When building a web application, you may encounter the SyntaxError: Cannot use import statement outside a module error. This error might be ...
Read more >
Cannot find module 'react' Error in TypeScript | bobbyhadz
import React from 'react'; console. log(React); This should fix the error and now TypeScript should be able to find the type definitions for...
Read more >
Project references: error when importing `tsx` file in referenced ...
I am able to workaround the error by adding "jsx": "react" to app/tsconfig.json , but this feels redundant. The file I am importing...
Read more >
Using TypeScript with React - DigitalOcean
This tutorial covers how to use TypeScript with React functional or ... App.tsx. import * as React from 'react'; import { render }...
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