randomtimetv
randomtimetv11mo ago

compiling issue with import { WebSocketServer } from "npm:ws@^8.14.1"

Using this impot in a "deno run --unstable [etc...]" env works flawless / as intended but trying to compile it, all of a sudden i get
'"internal:///missing_dependency.d.ts"' has no exported member 'WebSocketServer'
'"internal:///missing_dependency.d.ts"' has no exported member 'WebSocketServer'
5 Replies
Deno AI Helper
Deno AI Helper11mo ago
I'm sorry to hear you're having trouble with compiling your Deno project. According to the documentation, the deno compile command is still considered unstable and has some limitations. One of these limitations is that dynamic imports are not currently supported. However, the error message you're seeing seems to suggest that the WebSocketServer export cannot be found in the ws module. This could be due to a variety of reasons, such as the specific version of the ws module not having this export, or the module not being correctly downloaded or cached by Deno. Here are a few things you could try: 1. Make sure you're using the correct version of the ws module that includes the WebSocketServer export. 2. Try clearing Deno's dependency cache with deno cache --reload to ensure the latest version of the module is downloaded. 3. Make sure you're using the latest version of Deno, as improvements and bug fixes are regularly added. If none of these suggestions work, I would recommend creating an issue on the Deno GitHub repository, as the maintainers may be able to provide more specific assistance.
randomtimetv
randomtimetv11mo ago
1. is ( it works in the "deno run" enviorment but not in the "deno compile" 2. does not change the result 3. does not change the result
bartlomieju
bartlomieju11mo ago
Can you open an issue about it?
randomtimetv
randomtimetv11mo ago
where?
bartlomieju
bartlomieju11mo ago
GitHub
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 330 million projects.