Skip to content

Invalid Module Resolution for "fs/promises" and similar subpath imports #15

@jircdev

Description

@jircdev

Description

In the current version of the beyondjs framework, it seems that there's a problem with the module resolution mechanism. Specifically, attempting to use the following syntax for importing a subpath:

import * as fs from 'fs/promises';

results in an error indicating that the dependency is invalid:

Error: Dependency "fs/promises" is invalid

This issue is not limited to the fs/promises module. It occurs with any import statement where we try to access a subpath in a similar fashion.

Reproduction Steps

  1. Use the above import statement in a typescript file.
  2. Run the program.
  3. Observe the error.

Expected Behavior

The beyondjs framework should be able to correctly resolve these kinds of import statements, as they are a valid feature in Node.js versions v14.0.0 onwards.

Actual Behavior

An error is thrown indicating that the dependency is invalid.

Screenshots

image

System Information

  • BeyondJS version: 1.2.0-beta.1
  • Node.js version: v18.13.0

Additional Context

This issue is crucial to solve as this kind of import statement is common and valid in modern Node.js versions. It limits the usability of the beyondjs framework in projects that heavily rely on such imports.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions