Skip to content

Bundling package entrypoint files without extensions #2776

@shellscape

Description

@shellscape

e-Spirit/fcecom-frontend-api-server#1 explains what the the package in question is not doing correctly

To run into the error:
require('fcecom-frontend-api-server')

Results in:
"Build failed with 1 error:\napp.js:1:18: ERROR: Do not know how to load path: node_modules/fcecom-frontend-api-server/dist/cjs"

The issue is that ESBuild doesn't know what to do with the main entrypoint of dist/cjs - it's a file without an extension, oddly enough. Further oddity is that Node itself seems to do just fine with that and loads the extensionless file without issue. It's only due to that, that I'm opening an issue as the resolution algorithm seems to need some tweaking, or there needs to be a way to tell ESBuild what to do with that extensionless file.

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