You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ web3.eth.getAccounts()
65
65
66
66
### Usage with TypeScript
67
67
68
-
We do support types within the repo itself. Please open an issue here if you find any wrong types.
68
+
We support types within the repo itself. Please open an issue here if you find any wrong types.
69
69
70
70
You can use `web3.js` as follows:
71
71
@@ -74,6 +74,15 @@ import Web3 from 'web3';
74
74
const web3 =newWeb3("ws://localhost:8546");
75
75
```
76
76
77
+
If you are using the types in a `commonjs` module like for example a node app you just have to enable `esModuleInterop` in your `tsconfig` compile option, also enable `allowSyntheticDefaultImports` for typesystem compatibility:
78
+
79
+
```js
80
+
"compilerOptions": {
81
+
"allowSyntheticDefaultImports":true,
82
+
"esModuleInterop":true,
83
+
....
84
+
```
85
+
77
86
## Documentation
78
87
79
88
Documentation can be found at [read the docs][docs]
0 commit comments