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

SyntaxError: Missing initializer in destructuring declaration #49

Open
alkindivv opened this issue Feb 14, 2024 · 3 comments
Open

SyntaxError: Missing initializer in destructuring declaration #49

alkindivv opened this issue Feb 14, 2024 · 3 comments

Comments

@alkindivv
Copy link

i already declare LayerZero-SDK with this "const { LayerZero } require('@layerzerolabs/lz-sdk');"
but when i tried to run the code, i got this problem


EVM & Sol » node main-2.js                                                                                      ~/Desktop/EVM & Sol 1 ↵ 
file:///Users/alkindivv/Desktop/EVM%20&%20Sol/main-2.js:3
const { LayerZero } require('@layerzerolabs/lz-sdk');
      ^^^^^^^^^^^^^

SyntaxError: Missing initializer in destructuring declaration
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:155:18)
    at callTranslator (node:internal/modules/esm/loader:285:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30)
    at async link (node:internal/modules/esm/module_job:76:21)

Node.js v20.10.0

@oaknetinc
Copy link

Well done

@tamved
Copy link

tamved commented Feb 15, 2024

As for the issue you encountered with the LayerZero-SDK, it seems like there's a syntax error in the code. The correct syntax for importing the LayerZero module should be "const { LayerZero } = require('@layerzerolabs/lz-sdk');". Make sure to use the "=" sign after "LayerZero" in the destructuring declaration.

const { LayerZero } = require('@layerzerolabs/lz-sdk');

@alkindivv
Copy link
Author

My bad, thankyou!

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

No branches or pull requests

3 participants