Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant