Skip to content

Top-level await is not available in the configured target environment  #27607

@ChellappanRajan

Description

@ChellappanRajan

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

Description

Angular is throwing a 'Top-level await is not available' error when attempting to import the pdf-dist library.

What I have tried

I attempted to proceed with zoneLess, but the same error persists.

✘ [ERROR] Top-level await is not available in the configured target environment ("chrome123.0", "edge123.0", "firefox115.0", "ios16.0", "node22.0.0", "safari16.0" + 5 overrides)

Minimal Reproduction

https://github.com/ChellappanRajan/pdf-dist.git

Exception or Error

✘ [ERROR] Top-level await is not available in the configured target environment ("chrome123.0", "edge123.0", "firefox115.0", "ios16.0", "node22.0.0", "safari16.0" + 5 overrides)

    node_modules/pdfjs-dist/build/pdf.mjs:19764:53:
      19764 │ ...s__ = globalThis.pdfjsLib = await (globalThis.pdfjsLibPromis..

Your Environment

^18.0.0-next.0

Anything else relevant?

No response

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