forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: provide hints in terminal errors for Node.js globals (denoland#2…
…6610) Add info/hint for terminal errors related to Node.js globals: - __filename - __dirname - Buffer - global - setImmediate - clearImmediate Closes denoland#17494
- Loading branch information
1 parent
0e64163
commit 484f8ca
Showing
15 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,34 @@ | ||
{ | ||
"tests": { | ||
"__dirname": { | ||
"args": "run dirname.js", | ||
"output": "dirname.out", | ||
"exitCode": 1 | ||
}, | ||
"__filename": { | ||
"args": "run filename.js", | ||
"output": "filename.out", | ||
"exitCode": 1 | ||
}, | ||
"clearImmediate": { | ||
"args": "run clear_immediate.js", | ||
"output": "clear_immediate.out", | ||
"exitCode": 1 | ||
}, | ||
"buffer": { | ||
"args": "run buffer.js", | ||
"output": "buffer.out", | ||
"exitCode": 1 | ||
}, | ||
"global": { | ||
"args": "run global.js", | ||
"output": "global.out", | ||
"exitCode": 1 | ||
}, | ||
"setImmediate": { | ||
"args": "run set_immediate.js", | ||
"output": "set_immediate.out", | ||
"exitCode": 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
Buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
error: Uncaught (in promise) ReferenceError: Buffer is not defined | ||
Buffer; | ||
^ | ||
at [WILDCARD]buffer.js:1:1 | ||
|
||
info: Buffer is not available in the global scope in Deno. | ||
hint: Import it explicitly with import { Buffer } from "node:buffer";. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
clearImmediate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
error: Uncaught (in promise) ReferenceError: clearImmediate is not defined | ||
clearImmediate; | ||
^ | ||
at [WILDCARD]clear_immediate.js:1:1 | ||
|
||
info: clearImmediate is not available in the global scope in Deno. | ||
hint: Import it explicitly with import { clearImmediate } from "node:timers";. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
__dirname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
error: Uncaught (in promise) ReferenceError: __dirname is not defined | ||
__dirname; | ||
^ | ||
at [WILDCARD]dirname.js:1:1 | ||
|
||
info: __dirname global is not available in ES modules. | ||
hint: Use import.meta.dirname instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
__filename; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
error: Uncaught (in promise) ReferenceError: __filename is not defined | ||
__filename; | ||
^ | ||
at [WILDCARD]filename.js:1:1 | ||
|
||
info: __filename global is not available in ES modules. | ||
hint: Use import.meta.filename instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
global; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
error: Uncaught (in promise) ReferenceError: global is not defined | ||
global; | ||
^ | ||
at [WILDCARD]global.js:1:1 | ||
|
||
info: global is not available in the global scope in Deno. | ||
hint: Use globalThis instead, or assign globalThis.global = globalThis. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
setImmediate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
error: Uncaught (in promise) ReferenceError: setImmediate is not defined | ||
setImmediate; | ||
^ | ||
at [WILDCARD]set_immediate.js:1:1 | ||
|
||
info: setImmediate is not available in the global scope in Deno. | ||
hint: Import it explicitly with import { setImmediate } from "node:timers";. |