Skip to content

ESM struggle #294

@ricardo-valero

Description

@ricardo-valero

Hi, in my package.json I have two scripts, my start script is working, but dev using node-dev isn't

{
    "scripts": {
        "dev": "node-dev --experimental-specifier-resolution=node --loader ts-node/esm/transpile-only src/index.ts",
        "start": "node --experimental-specifier-resolution=node --loader ts-node/esm/transpile-only src/index.ts",
    },
   //...
}

I'm trying to work with ESM, because I need top level await

This is the error:

[ERROR] 19:34:14 RangeError: Unknown module format: null for URL file:///path_to_project/src/index.ts

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