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

TypeError: Receiver must be an instance of class anonymous #4521

Open
BeycanDeveloper opened this issue Dec 24, 2023 · 0 comments
Open

TypeError: Receiver must be an instance of class anonymous #4521

BeycanDeveloper opened this issue Dec 24, 2023 · 0 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@BeycanDeveloper
Copy link

Ethers Version

6.9.1

Search Terms

Receiver must be an instance of class anonymous

Describe the Problem

While it works fine when we include it in a normal HTML file, it gives the error in the title, probably because it is converted to Proxy in Vue JS. Even though I tried a few babel and webpack configurations, I could not find a solution.

It was the first time I encountered something like this and I thought the problem might be caused by the private method issue. Do you have any solution suggestions for this?

Webpack.confi.js
`const path = require('path');
const webpack = require('webpack');

module.exports = {
mode: 'production',
entry: './src/provider.js',
output: {
path: path.join(__dirname, "/dist"),
filename: 'evm-chains-provider.js',
library: 'EvmChains',
libraryTarget: 'umd',
globalObject: 'this',
umdNamedDefine: true,
},
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', {}],
],
plugins: [
'@babel/plugin-transform-private-methods',
],
},
},
},
],
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1, // disable creating additional chunks
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
resolve: {
extensions: ["", ".js", ".jsx"],
fallback: {
http: false,
https: false,
stream: false,
zlib: false,
}
}
};`

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

@BeycanDeveloper BeycanDeveloper added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants