-
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
ESM resolution for the web3-errors
package problem.
#6359
Comments
Thanks for creating issue, its fix will be available in next patch soon. |
By the way, I've noticed a similar issue in |
Ah, have no previous versions, just starting from scratch. How should all these packages be installed, which version and for which package? |
ya ... hope can fix this too...
as in Node documentation, must provide file extension..
|
Same problem, the '.js' extension should be strictly specified in these files
|
Same problem with
|
Same problem as above while using v4.0.3:
Using an older version of Web3 (4.0.3) also does not work as the dependencies of Web3 v4.0.3 includes web3-validator, web3-errors and their versions were stated as "^1.0.2" which caused the latest buggy version "2.0.0" or "1.1.0" to be pulled instead of the stable "1.0.2". |
A possible temporal workaround for me was to specify
For |
Fix is published in dev tag on npm: 4.1.1-dev.86f0cdb.0 |
It seems that this has resolved the issue. Thank you! Could you please provide an estimate for when we can anticipate an official release? |
@EmilIvanichkovv early next week ( #6367 ) |
@EmilIvanichkovv although this didn't worked for me, thanks for the suggestion. The dev release @jdevcs posted works!. |
The development release now appears to be functional on Windows and Mac M1s as well. Thank you, @jdevcs, for your contributions. Prior to this, I had observed consistent performance only on Linux machines. |
Patch release is now available : |
Thanks every one for testing dev and all feedback. |
Expected behavior
The ESM (ECMAScript Modules) resolution for the
web3-errors
package should function correctly.Actual behavior
Currently, the ESM resolution for the
web3-errors
package is not functioning as expected.Steps to reproduce the behavior
yarn add web3-errors
to install the web3-errors package.test.mjs
with the following content:node test.mjs
.Logs
Environment
Node.js v18.16.0
web3-errors@npm:1.1.0 (via npm:^1.1.0)
Additional Note:
Under the esm folder of the package, specifically in the file
node_modules/web3-errors/lib/esm/errors/rpc_error_messages.js
, there is a line:import { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, JSONRPC_ERR_CHAIN_DISCONNECTED, JSONRPC_ERR_DISCONNECTED, JSONRPC_ERR_REJECTED_REQUEST, JSONRPC_ERR_UNAUTHORIZED, JSONRPC_ERR_UNSUPPORTED_METHOD, } from '../error_codes';
This approach of importing from a relative path (../error_codes) might not be suitable for ESM (ECMAScript Modules). It seems that the import should be from
error_codes.js
. The potential root of this issue could be related to the packaging process. Yesterday, beforeRelease/4.1.0
ofweb3
with version1.0.2
ofweb3-errors
I didn't have this problemThe text was updated successfully, but these errors were encountered: