Skip to content
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

aelf-web3.js - building dist export error #177

Closed
AbigailDeng opened this issue Jul 5, 2024 · 0 comments · Fixed by #176
Closed

aelf-web3.js - building dist export error #177

AbigailDeng opened this issue Jul 5, 2024 · 0 comments · Fixed by #176
Assignees

Comments

@AbigailDeng
Copy link
Collaborator

AbigailDeng commented Jul 5, 2024

Description

aelf-web3.js recently underwent a dependency upgrade, which included upgrading from Webpack 4 to Webpack 5. This upgrade has introduced some issues due to Webpack's removal of built-in polyfills, requiring users to manually include necessary packages. As a result, the bundled output frequently throws errors related to missing process or similar variables. Additionally, there's a problem with the bundled output for Node.js environments using CommonJS: the external import statement const { AElf } = require('aelf-sdk') is generated, while the desired import is const AElf = require('aelf-sdk').

Steps To Reproduce

  • Ensure that the project includes dependencies that rely on process or other Node.js built-in modules.

  • Import the bundled file in a Node.js environment using const AElf = require('aelf-sdk').

The Current Behavior

The bundled output throws errors indicating that process or other built-in Node.js modules are missing.
The CommonJS module export in the bundled file results in the import statement const { AElf } = require('aelf-sdk'), which is not the intended usage.

The Expected Behavior

The bundled output should include necessary polyfills or configuration to avoid errors related to missing process or other built-in Node.js modules.
The CommonJS module export should result in the import statement const AElf = require('aelf-web3.js') to ensure correct usage in a Node.js environment.

Environment

Package: aelf-web3.js
Node.js Version: v20.8.1

@AbigailDeng AbigailDeng self-assigned this Jul 5, 2024
@AbigailDeng AbigailDeng linked a pull request Jul 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant