Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rinjugatla opened this issue Dec 20, 2023 · 1 comment

Comments

@rinjugatla
Copy link

I tested the code in a minimal environment using vite and get the following error.

X [ERROR] Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

node_modules/@deno/kv/esm/napi_based.js:34:31:
  34 │ const DEFAULT_NAPI_INTERFACE = await import('./_napi_index.cjs');
     ╵                                ~~~~~

We have prepared the code for testing in the following repository
This problem does not occur with min-node, but can be reproduced with min-vite.
https://github.com/rinjugatla/denokv-for-issue

This problem could also be solved by installing the following plugin.
https://github.com/Menci/vite-plugin-top-level-await

@rinjugatla rinjugatla changed the title Top-level await is not available in the configured target environment Issues Top-level await is not available in the configured target environment Dec 20, 2023
@rinjugatla
Copy link
Author

This is a problem due to the configuration on the vite side, so I don't think it is a problem for denokv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant