TypeScript error when importing into a React Project
See original GitHub issueHas 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:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @atesija,
You need to update your TypeScript package to latest version
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.