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
I faced the following errors when I used web3 as the only dependency inside the chainlink plugin:
node_modules/isomorphic-ws/index.d.ts:6:28 - error TS7016: Could not find a declaration file for module 'ws'. '/web3.js-plugin-chainlink/node_modules/ws/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/ws`if it exists or add a new declaration (.d.ts) file containing `declare module 'ws';`
6 import WebSocket = require('ws')
~~~~
node_modules/web3-providers-ws/lib/commonjs/index.d.ts:4:21 - error TS2305: Module '"isomorphic-ws"' has no exported member 'ClientOptions'.
4 import WebSocket, { ClientOptions, CloseEvent } from 'isomorphic-ws';~~~~~~~~~~~~~
node_modules/web3-providers-ws/lib/commonjs/index.d.ts:4:36 - error TS2305: Module '"isomorphic-ws"' has no exported member 'CloseEvent'.
4 import WebSocket, { ClientOptions, CloseEvent } from 'isomorphic-ws';~~~~~~~~~~
node_modules/web3-providers-ws/lib/commonjs/index.d.ts:4:54 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
4 import WebSocket, { ClientOptions, CloseEvent } from 'isomorphic-ws';~~~~~~~~~~~~~~~
node_modules/web3-providers-ws/lib/commonjs/index.d.ts:8:10 - error TS2305: Module '"isomorphic-ws"' has no exported member 'ClientOptions'.
8 export { ClientOptions } from 'isomorphic-ws';~~~~~~~~~~~~~
node_modules/web3-providers-ws/lib/commonjs/index.d.ts:8:31 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
8 export { ClientOptions } from 'isomorphic-ws';~~~~~~~~~~~~~~~
node_modules/web3-providers-ws/lib/commonjs/index.d.ts:1:23 - error TS2688: Cannot find type definition file for'ws'.
1 /// <reference types="ws" />~~
We need to prevent this error from happening without the addition of @types/ws to the devDependencies to the project that uses web3.
And we need to prevent this for all devDependencies used inside our sub-packages. The error shows for ws. But it could happen with other packages depending on the scenario.
The text was updated successfully, but these errors were encountered:
Description
I faced the following errors when I used
web3
as the only dependency inside the chainlink plugin:And I had overcome his by adding
@types/ws
to thedevDependencies
as you can find in: https://github.com/ChainSafe/web3.js-plugin-chainlink/pull/27/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519Steps to reproduce the behavior
https://github.com/ChainSafe/web3.js-plugin-chainlink
and checkout the branch1-use-only-web3-as-dependency
."@types/ws"
from the project devDependencies. It is located at line https://github.com/ChainSafe/web3.js-plugin-chainlink/pull/27/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519yarn && yarn build
.Thoughts
We need to prevent this error from happening without the addition of
@types/ws
to thedevDependencies
to the project that usesweb3
.And we need to prevent this for all
devDependencies
used inside our sub-packages. The error shows forws
. But it could happen with other packages depending on the scenario.The text was updated successfully, but these errors were encountered: