Ren Hiyama
Ren Hiyama13mo ago

Deno showing node globalThis error

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...
14 Replies
Ren Hiyama
Ren Hiyama13mo ago
I believe deno is adding so of its own lines at the top of the dependency?
NeTT
NeTT13mo ago
can you show some reproducible code?
Ren Hiyama
Ren Hiyama13mo ago
# 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 ^^
NeTT
NeTT13mo ago
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
Ren Hiyama
Ren Hiyama13mo ago
@retraigo its doesnt support windows file system urls atm, try running it on git bash terminal or wsl2
NeTT
NeTT13mo ago
ah ay
Ren Hiyama
Ren Hiyama13mo ago
@retraigo could you reproduce the bug?
NeTT
NeTT13mo ago
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
NeTT
NeTT13mo ago
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...
Ren Hiyama
Ren Hiyama13mo ago
@retraigo deleting package json won't fix it though I want a way without adding additional args to deno
NeTT
NeTT13mo ago
removing package.json just gives me a normal error
Ren Hiyama
Ren Hiyama13mo ago
@retraigo did you remove package json inside packit or the main folder?
NeTT
NeTT13mo ago
packit
Ren Hiyama
Ren Hiyama13mo ago
Hmm Yea deleting package.json fixes my problem. Thanks.