0

Following a tutorial to build a Twitter clone and I have to import:

import { FiMoreHorizontal } from 'react-icons/fi' 2.3K (gzipped: 1K) import { VscTwitter } from 'react-icons/vsc' 3.1K (gzipped: 1.5K)

I get this.....

Error: error: Identifier cannot follow number

| 1 | import { FiMoreHorizontal } from 'react-icons/fi' 2.3K (gzipped: 1K) | ^

Caused by: 0: failed to process js file 1: Syntax Error

dustycar17
  • 27
  • 6
  • Did you actually install the react icons library in your applications root directory with npm or yarn? is that `2.3k (gzipped: 1k)` really at the end of your import line? – PhilCowan Mar 24 '22 at 21:32
  • Ran this code: npm install react-icons --save – dustycar17 Mar 24 '22 at 21:52
  • import { FiMoreHorizontal } from 'react-icons/fi' 2.3K (gzipped: 1K) import { VscTwitter } from 'react-icons/vsc' 3.1K (gzipped: 1.5K) ***The next line of code*** const style = { – dustycar17 Mar 24 '22 at 21:54
  • 1
    @PhilCowan's answer should help. On a side note, to save you a bit of typing, you no longer need the `--save` flag in npm and you can use `i` instead of `install`, so your command can look like this `npm i react-icons`. If installing a dev dependency, run something like this `npm i morgan -D`. – Alexiz Hernandez Mar 24 '22 at 22:44

1 Answers1

1

Provided that React Icons was installed in the correct directory, you can double check that by looking in package.json if it lists react-icons in the dependencies object you should be good to go.

The import should not include anything after the quotes.

import { FiMoreHorizontal } from 'react-icons/fi'

PhilCowan
  • 523
  • 5
  • 13