'Importing and using Web3 in React causing a compilation issue
After trying to import and use Web3 into my ReactJS project, I am getting the following issue:
Not sure exactly why it is doing this. Here is how I am importing the library and where I am using the Web3 library.
import Web3 from 'web3';
console.log(Web3.utils.isAddress('0xc1912fee45d61c87cc5ea59dae31190fffff232d'));
I have also tried to use the nodeJs way of importing things like:
const Web3 = require('web-3');
And it is yielding same result.
The error seems to be that I need an 'appropriate loader to handle that type of file' but not sure how to handle that. If you have any ideas, please let me know! Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

