denoland / denokv

A self-hosted backend for Deno KV
https://deno.com/kv
MIT License
456 stars 21 forks source link

Issues No loader is configured for ".node" files: ... deno-kv-napi.win32-x64-msvc.node #59

Closed rinjugatla closed 8 months ago

rinjugatla commented 9 months ago

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

X [ERROR] No loader is configured for ".node" files: node_modules/@deno/kv-win32-x64-msvc/deno-kv-napi.win32-x64-msvc.node

node_modules/@deno/kv/esm/_napi_index.cjs:41:36:
  41 │             nativeBinding = require('@deno/kv-win32-x64-msvc')
     ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~

14:29:21 [vite] error while updating dependencies: Error: Build failed with 2 errors: node_modules/@deno/kv/esm/_napi_index.cjs:41:36: ERROR: No loader is configured for ".node" files: node_modules/@deno/kv-win32-x64-msvc/deno-kv-napi.win32-x64-msvc.node node_modules/@deno/kv/esm/napi_based.js:34:31: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides) at failureErrorWithLog (D:\workspace\test\denokv-for-issue\min-vite\node_modules\esbuild\lib\main.js:1650:15) at D:\workspace\test\denokv-for-issue\min-vite\node_modules\esbuild\lib\main.js:1058:25 at D:\workspace\test\denokv-for-issue\min-vite\node_modules\esbuild\lib\main.js:1526:9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

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

rinjugatla commented 8 months ago

Processes that should have been executed on the server side were being executed on the client side. This is not a Issue.