Skip to content

ZNTC0001: Top-level await is not available in the configured target environment

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

Category: Target/Compatibility

export const data = await fetch("/api");

Options: --target=es2021

Reproduce in Playground →

See the error message for cause and resolution.