Skip to content

[BUG] Top Level Await #1885

Closed
Closed

Description

@angelhdzmultimedia

Search Terms

Expected Behavior

Being able to use top level await in a node typescript project.

Actual Behavior

Tons of errors no matter what combination of tsconfig.json, package.json and compiler flags I try.

Other solutions

I tried one setup using nodemon and babel and it worked, but with ts-node or ts-node-dev I can't get it working
and my search history is huge! Can't find a solution.
Even a solution I left someone else in the past, isn't currently working!!!
The solution was: nodemon -I --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/main.ts

Please, help!!!

Steps to reproduce the problem

Minimal reproduction

Specifications

  • ts-node version: 10.9.1
  • node version: 18.1.0
  • TypeScript version: 4.8.3
  • tsconfig.json, if you're using one:
{}
  • package.json:
{}
  • Operating system and version: Windows 10.0.19044 Build 19044

  • If Windows, are you using WSL or WSL2?:

Activity

  1. locked and limited conversation to collaborators on Sep 11, 2022
  2. converted this issue into a discussion #1886 on Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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