Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

.js modules not found #10

@c-ciobanu

Description

@c-ciobanu

Trying to import a .js file as this

  import:
    - module: config/dynamic.js
      inputs:
        var: test

will throw the following error.

Error: Cannot import config/dynamic.js
Cause: Cannot find module 'config/dynamic.js'

The problem seems to be with the import path, the issue seems to be in this check that will not fail

if (tryOrUndefined(() => statSync(pathToImport))) {

but the subsequent require will.
const importExports = require(importPath)

Removing the check fixes the problem.
A solution would be to bypass the check if the file has a .js ext or completely removing the check but don't know if that impacts something else, didn't dig too much into the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions