Replies: 17 comments
-
That is odd. That means that your build is using your The next version (v5.2), which should be out this week adds null to the allowable types within the Filter, so this will be fixed then. In the meantime, if you remove the If you can find a better way to make TypeScript+WebPack properly follow to the |
Beta Was this translation helpful? Give feedback.
-
Could the |
Beta Was this translation helpful? Give feedback.
-
The
|
Beta Was this translation helpful? Give feedback.
-
Running with the following in
still outputs the same thing |
Beta Was this translation helpful? Give feedback.
-
Turning off strict was the only solution (tried older versions of nextjs and ethers, neither helped) |
Beta Was this translation helpful? Give feedback.
-
Thanks for letting me know. The next major version (v6) will also have strict enabled, but that is still a month or two away. If anything else comes to mind, feel free to update this issue. |
Beta Was this translation helpful? Give feedback.
-
Sounds good, looking forward to it! Also thank you for creating such a wonderful library :) |
Beta Was this translation helpful? Give feedback.
-
Did 5.2 fix this issue, by the way? |
Beta Was this translation helpful? Give feedback.
-
@esemeniuc I had this issue and it ended up that I was importing from @ethersproject/providers/src.ts instead of ethers or @ethersproject/providers. In my case I was typing the JsonRpcProvider. (Updated thanks to @ricmoo ) Causes Type issuesimport { JsonRpcProvider } from "@ethersproject/providers/src.ts/json-rpc-provider";
let provider: JsonRpcProvider; Worksimport { JsonRpcProvider } from "@ethersproject/providers";
let provider: JsonRpcProvider; Also Worksimport { ethers } from "ethers";
let provider: ethers.providers.JsonRpcProvider; |
Beta Was this translation helpful? Give feedback.
-
What was the Type issue? I would expect it to fully fail, since the Can you try Ethers isn’t designed for pulling things out of the internal folders or files. |
Beta Was this translation helpful? Give feedback.
-
@ricmoo That is correct "@ethersproject/providers" works. I was not clear enough. |
Beta Was this translation helpful? Give feedback.
-
Oh! Thanks. Is IntelliJ the auto-completion part of VSCode? How does it decide which files to pick? It seems weird it targets the |
Beta Was this translation helpful? Give feedback.
-
I'm not sure. Once I tried your import, it started importing it correctly after that. Sometimes it gets a bit autocomplete happy and digs into stuff that really shouldn't be imported (like .../src.ts/json-rpc-provider). My guess is that something similar happened to @esemeniuc |
Beta Was this translation helpful? Give feedback.
-
@ricmoo I retested with the latest
|
Beta Was this translation helpful? Give feedback.
-
IntelliJ is a code editor from Jetbrains, but VSCode does use Intellisense, where it indexes functions and types from code. I use Webstorm (based on IntelliJ, but for JS). IntelliJ/Webstorm will index all the files based on defaults or source directory configuration, and it will index many different file types. Folders can be manually excluded, but I am not very familiar with the process |
Beta Was this translation helpful? Give feedback.
-
@esemeniuc just to confirm, can you try removing your lock file and node_modules and reinstalling it? |
Beta Was this translation helpful? Give feedback.
-
@zemse I ran
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When building with webpack 5 and Nextjs 10.2.0 with ethers 5.1.4, I get the following error:
Reproduction steps
Run
next build
on my projectEnvironment:
Running via cli on the following:
This is my
tsconfig.json
Search Terms
webpack 5
nextjs
ethers
Beta Was this translation helpful? Give feedback.
All reactions