German_Noob
Running multiple Deno versions at the same time
I am kind of interested in what your use-case for running multiple versions of deno is. In general I would think that it should be safe to run multiple versions. If you do a version update you keep using the same caches and all so the structure and format of those files and folders probably don't change much.
There is a good chance for conflicts if two programs try to pull the same dependency at the same time but I think that is relatively unlikely to happen.
I think it's best to just try it out
7 replies
'React' refers to a UMD global, but the current file is a module.
You can try using a triple slash directive to tell deno that the react types are in fact present.
https://docs.deno.com/runtime/manual/advanced/typescript/types#using-a-triple-slash-directive
You place those directives at the entry point to your application. For your tests it could be your vitest config.
Gl
11 replies
'React' refers to a UMD global, but the current file is a module.
Hi 👋
You are using deno as a drop-in replacement to node for a next.js project with vitest as test runner.
Frameworks like next and test runner like vitest do a lot of stuff under the hood. Configuration of those tools can be incredibly difficult. Even when using the runtime those tools were developed for.
1. Your problem might not be related to deno.
Make sure the project is configured correctly first. I've seen a bun lock file in your repo. Try running your tests with bun to check if the configuration is correct.
2. Deno is not intended to be a drop-in replacement for node. A lot of work was done to improve the compatibility with existing frameworks and libraries but it is not perfect and probably never will. There is still no guarantee that a node project can be run using deno. Last time I checked, next only worked in SSG Mode https://github.com/denoland/nextjs_static_template/
I don't know what the current state of deno is regarding next but there are similar projects native to the deno ecosystem that might be a better choice.
I've seen https://alephjs.org/ pop up several times regarding this. Another popular choice is https://fresh.deno.dev/
3. You can try to debug the problem yourself. There is a 3 year old stack overflow question regarding a similar problem. https://stackoverflow.com/questions/64656055/react-refers-to-a-umd-global-but-the-current-file-is-a-module
Gl
11 replies