Compiling code breaks it (except on Linux)
error: [ERR_MODULE_NOT_FOUND] Cannot find module "C:\Users\Eris\AppData\Local\Temp\deno-compile-llm-bot.exe\node_modules\localhost\discord-api-types\0.37.61\payloads\v10../common" imported from "C:\Users\Eris\AppData\Local\Temp\deno-compile-llm-bot.exe\node_modules\localhost\discord-api-types\0.37.61\payloads\v10\index.js"
compiled with below command repo at https://github.com/Erisfiregamer1/llm-bot
deno compile --no-check --allow-all --unstable --target x86_64-pc-windows-msvc --output compiled/llm-bot.exe main.ts
GitHub
GitHub - Erisfiregamer1/llm-bot
Contribute to Erisfiregamer1/llm-bot development by creating an account on GitHub.
2 Replies
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with module resolution paths that are specific to the Windows file system.
The error message indicates that the module resolution is looking for a path with "node_modules" in it, which is not typical for Deno projects as Deno does not use
node_modules
by default. Deno uses URLs or file paths for module imports. This might be an issue with a third-party module that is not properly compatible with Deno, or it could be an issue with the way the paths are being resolved in the compiled output.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. It might be helpful to look into the following:
1. Ensure that all your dependencies are Deno-compatible and do not rely on Node.js-specific features or directory structures.
2. Check your import statements to make sure they are using URLs or relative paths that are compatible with Deno's import system.
3. If you are using third-party modules that are not designed for Deno, you may need to find Deno-specific alternatives or use a compatibility layer like deno_std/node
.
Since this issue seems to be related to module resolution on Windows, you might also want to check if there are any known issues with the deno compile
command on Windows, especially with the --target
flag you're using.
Remember to consult the Deno manual or the community for further assistance if needed.maybe compiling npm deps for Windows is not working properly. See https://github.com/denoland/deno/issues/22690
GitHub
deno compile
cross compilation does not work Linux -> Windows · I...Discussed in #22685 Originally posted by mabasic March 4, 2024 I'm not opening an issue yet, because I'm typing this on mobile ... here it goes. I'm using Deno 1.41.1 and when I run den...