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

Did you find this page helpful?