D
Deno

help

migrate from node to deno: p5js project

KKitamado9/23/2023
Hi, I want to rewrite my p5js project built with nodejs in deno. Here is my code: https://github.com/Seasawher/p5js I would like to preview it using VSCode's liverServer extension. I am a beginner and do not know how to rewrite it in deno. Any advice would be appreciated.
GitHub
GitHub - Seasawher/p5js: WIP: work in progress
WIP: work in progress. Contribute to Seasawher/p5js development by creating an account on GitHub.
BSBirk Skyum9/23/2023
Hi @seasawher , when this ticket is resolved https://github.com/denoland/deno/issues/20613, you should be able to simply do deno task dev, and maybe make small correction to the package.json/deno.json. Deno is great at server stuff, but it's still lacking a lot of npm/node compat in the frontend space. Not sure if there's some deno-native api's you can use for this instead, since the deno run and deno bundle doesn't accept a .html file in the same was Parcel does.
GitHub
Issues · denoland/deno
A modern runtime for JavaScript and TypeScript. Contribute to denoland/deno development by creating an account on GitHub.
KKitamado9/23/2023
@birkskyum Thanks for your reply. Does this mean that it is impossible to run p5js with just deno until the issue is resolved? I would like to migrate from nodejs, even if the code structure changes a bit.
BSBirk Skyum9/23/2023
No, it's possible to use these things together. Here's i.e. a setup with p5 / vitejs running with deno. https://github.com/birkskyum/deno-p5-vanilla
GitHub
GitHub - birkskyum/deno-p5-vanilla
Contribute to birkskyum/deno-p5-vanilla development by creating an account on GitHub.
KKitamado9/23/2023
Thank you very much!!!
KKitamado9/24/2023
It works fine locally, but not where I deployed it with deno deploy. What did I do wrong? Here is my code:https://github.com/Seasawher/game-of-life deploy to: https://seasawher-game-of-life.deno.dev/
GitHub
GitHub - Seasawher/game-of-life: Conway's game of life. WIP 🚧: work...
Conway's game of life. WIP 🚧: work in progress. Contribute to Seasawher/game-of-life development by creating an account on GitHub.
KKitamado9/24/2023
Thank you very much. However, even after the merge of your PR, deployment still does not seem to be working. Locally, it still works correctly. In the developer tools, the following error message appears in the deployed environment.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
BSBirk Skyum9/24/2023
Right, it could be a missing file extension. In index.tsx, try importing "./constants.ts"; instead of "./constants"; It's mentioned here that the .ts is required: https://github.com/denoland/deno/issues/2506#issuecomment-501223236 Hope that helps
KKitamado9/25/2023
Thank you very much. I changed the file extension, but it still doesn't seem to be working. The error message has not changed either. my code is here: https://github.com/Seasawher/game-of-life
GitHub
GitHub - Seasawher/game-of-life: Conway's game of life. WIP 🚧: work...
Conway's game of life. WIP 🚧: work in progress. Contribute to Seasawher/game-of-life development by creating an account on GitHub.
BSBirk Skyum9/25/2023
Very annoying. Deno unfortunately isn't mature for frontend stuff yet
ABAltair 680b9/25/2023
There is hardly anything there. Why not just use a canvas and a 2Dcontext?
KKitamado9/26/2023
Thanks for taking the time to think about this... anyway. Any ideas? Please tell me more about it.

Looking for more? Join the community!

Recommended Posts
Peer dependencyCan I somehow mark a dependency as "peer"? So this dependency (which is known to shuffle typings bet'Spawn' multiple promises from the same moduleI'm trying to use Deno for scripted npcs in a game, the main issue that the npc has to await user acReturn results from execute_main_moduleI currently have this function to run some execute some js ``` pub async fn run(&self, path_to_Fresh Blog + Website Thingshttps://vuepress-theme-yuu.netlify.app/, what is the closest thing to that which can be run on FreshDetermine subcommandIf I run `deno test` from the command line, how can I determine that `test` is the subcommand being setting a cookie for import requestsis there a way to modify request headers or set cookies for the GET requests that deno makes when reHow to run tailwindcss cli with deno task?I would like to be able to run the tailwindcss cli tool to watch and build stylesheets as per their Deno DeployIs it possible to use only cronjobs on deno deploy?Deno cannot import mainfile by reading from package.jsondeno 1.36.0 (release, x86_64-unknown-linux-gnu) v8 11.6.189.12 typescript 5.1.6Deno LSP in a Web WorkerHas anyone come across the lsp running in a web worker? I have an online editor (Monaco) that peopleHow do you get a Deno Jupyter notebook to recognize Deno and other types in vscode?See attached screenshotModule not found when running deno runSomething weird has started happening. When I run `deno run src/main.ts` it seems as if Deno is tryesm_entry_point / extension macro; ReferenceErrorHow do I use esm_entry_point properly? I defined my extension as: ```rust extension!( ext_name,remoteAddr returning localhost on Deno DeployI saw this thread (https://discord.com/channels/684898665143206084/1055631150787334184) about gettinDeno-native Nuxt.js?The recent [The State of Web Frameworks on Deno](https://deno.com/blog/web-frameworks-on-deno) blogDeno support Fleet IDE?Hello, can the deno plug-in be used on the Fleet editor of JetBrains IDEs? Thank you.Async execution contextIs there any way I can create a global that is unique to an async operation? I would like to use thaError Deploying to Deno Deploy LODASH isEmpty.jsI am having issues deploying to deno deploy. All was well 3 days ago. Made some changes today - but need to refersh page for message each time a user from different country sends a messageHey I was going through the below deno chat app and found a bug which is the need to referesh the paAPI architecture for generic callbackHi there, I have a general question about code architecture for an API I'm doing. Basically, it list