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

Code is executed in require #921

Open
ishaiavrahami opened this issue Sep 20, 2022 · 0 comments
Open

Code is executed in require #921

ishaiavrahami opened this issue Sep 20, 2022 · 0 comments

Comments

@ishaiavrahami
Copy link

Hello, i'm using the following code and it seems to execute the function in the import even though i haven't even called the function yet. Any reason for this behavior?

const _require = require("esm")(module);
try {
    let code = _require('test.js');
 } catch (error) {
        error ->   if (!params?.plugin_setup?.[params.propsP.fieldA]) {
                        ^ SyntaxError: Invalid or unexpected token
 }
@ishaiavrahami ishaiavrahami changed the title Code is executed in import Code is executed in require Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant