D
Deno

help

Deno showing node globalThis error

RHRen Hiyama6/1/2023
Deno is showing this error:
error: Uncaught ReferenceError: __DENO_NODE_GLOBAL_THIS_0_43_0__ is not defined
at file:///home/ren/coding/frontend/packit/node_modules/@reejs/imports/env.js:1:18
error: Uncaught ReferenceError: __DENO_NODE_GLOBAL_THIS_0_43_0__ is not defined
at file:///home/ren/coding/frontend/packit/node_modules/@reejs/imports/env.js:1:18
The mentioned file starts as this:
// learn what runtime are we using based on their differences: nodejs, deno,
// bun, or else edge
let runtime = "browser";
if (typeof Deno !== "undefined") {
runtime = "deno";
} else if (typeof Bun !== "undefined") {
runtime = "bun";
} else if (typeof process !== "undefined") {
if (process.versions.node) {
runtime = "node";
const originalEmit = process.emit;
process.emit = function(name, data, ...args) {
if (name === `warning` && typeof data === `object` &&
data.name === `ExperimentalWarning`)
return false;
//more lines of code...
// learn what runtime are we using based on their differences: nodejs, deno,
// bun, or else edge
let runtime = "browser";
if (typeof Deno !== "undefined") {
runtime = "deno";
} else if (typeof Bun !== "undefined") {
runtime = "bun";
} else if (typeof process !== "undefined") {
if (process.versions.node) {
runtime = "node";
const originalEmit = process.emit;
process.emit = function(name, data, ...args) {
if (name === `warning` && typeof data === `object` &&
data.name === `ExperimentalWarning`)
return false;
//more lines of code...
I believe deno is adding so of its own lines at the top of the dependency?
NNeTT6/1/2023
can you show some reproducible code?
RHRen Hiyama6/1/2023
# install reejs
npm i -g reejs
# setup project
reejs init test --features react,tailwind,api,static
# move to project
cd test
# install required deps
reejs i && reejs sync && npm i
# package current code for deno runtime, I believe deno deploy has same APIs as deno, if not more
reejs packit deno-deploy
# run the build code
deno run -A ./packit/index.js
# install reejs
npm i -g reejs
# setup project
reejs init test --features react,tailwind,api,static
# move to project
cd test
# install required deps
reejs i && reejs sync && npm i
# package current code for deno runtime, I believe deno deploy has same APIs as deno, if not more
reejs packit deno-deploy
# run the build code
deno run -A ./packit/index.js
@retraigo ^^
NNeTT6/1/2023
ENOENT: no such file or directory, mkdir '\C:\Users\Schatten%20Et%20Caligo\AppData\Local\pnpm\global\5\.pnpm\@reejs+imports@2.1.9\.reejs\cache'
ENOENT: no such file or directory, mkdir '\C:\Users\Schatten%20Et%20Caligo\AppData\Local\pnpm\global\5\.pnpm\@reejs+imports@2.1.9\.reejs\cache'
when trying to run > reejs
RHRen Hiyama6/1/2023
@retraigo its doesnt support windows file system urls atm, try running it on git bash terminal or wsl2
NNeTT6/1/2023
ah ay
RHRen Hiyama6/1/2023
@retraigo could you reproduce the bug?
NNeTT6/1/2023
yep I'm looking into it seems it has to do with the "auto discovery of node_modules with package.json" passing --no-config might help
NNeTT6/1/2023
GitHub
deno repl Uncaught ReferenceError: DENO_NODE_GLOBAL_THIS_XXX ...
Reproduce $ tail -n +1 * ==> app.mts <== await import('reproduce') ==> deno.jsonc <== { "imports": { "ip-regex": "npm:ip-regex@5.0.0", "reprod...
RHRen Hiyama6/1/2023
@retraigo deleting package json won't fix it though I want a way without adding additional args to deno
NNeTT6/1/2023
removing package.json just gives me a normal error
RHRen Hiyama6/1/2023
@retraigo did you remove package json inside packit or the main folder?
NNeTT6/1/2023
packit
RHRen Hiyama6/1/2023
Hmm Yea deleting package.json fixes my problem. Thanks.

Looking for more? Join the community!

Recommended Posts
How to read Chunked request body?Hello! Is it possible to read a chunked request body using `for await`? It seems to only read up to Deno Fresh (Saaskit base) - Impossible to debug errorWhen I try to access my account by logging in, the web app becomes unusable and I get this errorPossible to deploy the chat example to deno deploy?I would like to try running this demo on deno deploy: https://deno.com/manual@v1.34.0/examples/chat`dnt` incompatible with `addEventListener`?I am using the log/mod.ts module from deno_std and running `dnt` with no special configuration as faSaaskit 0.2.0 - URLPattern errorI followed the README.md but when running `deno task start` this error pops up (image) How can i fiRunning `deno cache` fails often with internal server errors when importingExample message ``` error: Import 'https://deno.land/std@0.175.0/path/_constants.ts' failed: 500 IntHow many Web Platform tests should deno be passing?I wanted to package Deno as RPMs but before I started that, I'm getting very different test results Deno Deploy with Cloudflare ProxyIs it possible to use Cloudflare proxy with Deno deploy website? Cloudflare provides countryCode inDeno event loop and gui applicationHi, I am trying to write custom gtk library in deno using `gtk-rs` and `deno_runtime`. I already havSimple type narrowing/type guard/assertion (?)Is there really no simpler way of doing this _without_ `any` and without external deps? ```ts exporImport is "Not yet initialized?"No idea what this means. First screenshot is error, second screenshot is problematic line, third scHow are deno processes/isolates managed in Deploy?Hi, I'm writing a multiplayer game in Deno and currently all of the game state is kept in module-scoCannot access web server from other network devices when compiledHello. Im kinda new to deno and i just compiled my first bigger project with deno, but when the taskHow to use chrome devtools / inspector with Deno?Hello all! I'd like to profile my game server written in Deno to identify the hot spots. I see thaClear local KV storeHow do I delete/clear the local database?Deno.Command not working for applicationHello. Im trying to start an application using Deno.Command, but it for some reason doesnt work. TheUint8Array or Float32ArrayIs there any significant difference between using a Float32Array and using a Uint8Array from the samSending proper Content-Type depending on file sentHello. Im new to Deno and TypeScript and i wanted to convert one of my older projects (NodeJs and JaReclaim an already registered module?Is it possible to reclaim an already registered third party module? For example if the module that iDeno.readDir on current script even if used like an http package.Hello !! I would like to do Deno.readDir and readFiles on files relative to the script that execute