-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing web3 cause error: You may need an additional loader to handle the result of these loaders #6472
Comments
Hello @jasonhtpham , import { Web3 } from "web3"; This is documented in the migration guide in the docs. I will close the issue. However, please, feel free to open it if you used this and you are still facing the same error. And if you used this but faced another error message. Please open a new issue for it. Have a nice day, |
Hi @Muhammad-Altabba, I just tried: import { Web3 } from 'web3';
export const web3 = new Web3(Web3.givenProvider || "ws://localhost:8545"); It still gives the same error. |
Thanks @jasonhtpham , |
Hi @Muhammad-Altabba, please refer to this repo: https://github.com/jasonhtpham/react-boilerplate.git I used this as testing codebase. I added web3 to Then, I installed and ran using I am using:
|
I am also able to reproduce above issue, and got:
@jasonhtpham Thanks for details. It should be investigated and fixed in next sprint. |
Hello @jdevcs , "browserslist": {
"production": [
"chrome >= 67",
"edge >= 79",
"firefox >= 68",
"opera >= 54",
"safari >= 14"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}, |
Hello @jasonhtpham , |
Hi @jasonhtpham, However, form our side, we will also work on ensuring the syntax used in the minified file is es5. And I created an issue to trace the work on this. |
Expected behavior
Web3 gets imported and ready to be used.
Actual behavior
When I remove the import of the web3 my application works fine.
Steps to reproduce the behavior
npm i web3
npm start
Logs
N/A
Environment
This is my package.json:
This is my
web3.js
file:The text was updated successfully, but these errors were encountered: