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

Code is executed in require #921

@ishaiavrahami

Description

@ishaiavrahami

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
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions