FortAwesome / react-fontawesome

Font Awesome React component
https://fontawesome.com
MIT License
3.68k stars 264 forks source link

Error on mounting and import {fontAwesomeIcon} in React shared components #385

Open csmaller opened 4 years ago

csmaller commented 4 years ago

in package.json: "@fortawesome/fontawesome-svg-core": "^1.2.30", "@fortawesome/free-solid-svg-icons": "^5.14.0", "@fortawesome/react-fontawesome": "^0.1.11",

in a shared component (npm linked to a main project).... import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"

once compiled the log in the main repo that imports all the shared components breaks with this error:

Generating development JavaScript bundle failed

C:\Dev\dist\index.js: Unexpected token, expected ";" (31478:18)

31476 | function installNextTickImplementation() { 31477 | registerImmediate = function(handle) {

31478 | {"env": {}}.nextTick(function () { runIfPresent(handle); }); | ^ 31479 | }; 31480 | } 31481 |

File: ..\dist\index.js:31478:18

failed Re-building development bundle - 3.203s

------- i remove the <FontAwesomeIcon ...> and it compiles properly

renan-khalibre commented 4 years ago

I'm having the same issue.

kozakdenys commented 4 years ago

@csmaller @renan-khalibre I had the same issue. It was caused by dotenv-webpack version 3.0.0. Downgrading it to 2.0.0 resolved the issue.