`deno compile` executable not working with cross-platforms
I have a basic app (frontend using vite and backend using oak) which upon a button click displays a message from the backend. This app is working totally fine on my personal laptop having Ubuntu (24.04.1 LTS), after running
deno compile -A --output linux_app main.js
, and then running ./linux_app
to see my app running on http://localhost:8000
. I'm using the useState
hook - import { useState } from "react";
, hence node_modules
's existence being there in my project.
The issue arises when I compile the app to a Windows executable by specifying --target x86_64-pc-windows-msvc
. I get the following warning:
Warning The node_modules directory may be incompatible with the target system.
The exe file is generated nonetheless. I tried testing this exe on my Windows 11 work laptop (uploaded the exe on OneDrive), and after I double click it and go to http://localhost:8000
, the browser gives a 404 Error, saying "This localhost page can't be found".
I get the same node_modules warning when I tried compiling it to a macOS executable (did not test it on a macOS machine).
If someone could really aid me here, would highly appreciate it. I thought deno compile
supported npm packages as stated in https://deno.com/blog/v1.34.0 Replies