summaryrefslogtreecommitdiff
path: root/runtime/fmt_errors.rs
AgeCommit message (Collapse)Author
2024-11-14feat(cli): add `--unstable-node-globals` flag (#26617)Marvin Hagemeister
This PR adds a new `--unstable-node-globals` flag to expose Node globals by default. Fixes https://github.com/denoland/deno/issues/26611 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-10-29fix: provide hints in terminal errors for Node.js globals (#26610)Bartek Iwańczuk
Add info/hint for terminal errors related to Node.js globals: - __filename - __dirname - Buffer - global - setImmediate - clearImmediate Closes https://github.com/denoland/deno/issues/17494
2024-10-22refactor: add 'docs' suggestion (#26463)Bartek Iwańczuk
Adds another kind to `FixSuggestionKind` specifically for links documentation pages.
2024-10-15fix: improve suggestions and hints when using CommonJS modules (#26287)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/26225
2024-10-15fix: add hint for missing `document` global in terminal error (#26218)Bartek Iwańczuk
This came up on Discord as a question so I thought it's worth adding a hint for this as it might be a common pitfall. --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-10-15refactor: always apply hint when formatting JsError (#26252)Bartek Iwańczuk
Moves code for generating suggestions and hint to `cli/fmt_errors.rs`. This effectively applies suggestion to any place that format JS errors in terminal, like `deno test`. Addresses https://github.com/denoland/deno/pull/26218#issuecomment-2409139055
2024-10-01feat: Add suggestion for packages using Node-API addons (#25975)Bartek Iwańczuk
This commit adds a suggestion with information and hint how to resolve situation when user tries to run an npm package with Node-API addons using global cache (which is currently not supported). Closes https://github.com/denoland/deno/issues/25974
2024-09-05fix: add suggestion how to fix importing CJS module (#21764)Bartek Iwańczuk
``` $ cat exports_error.js Object.defineProperty(exports, "__esModule", { value: true }); $ deno exports_error.js error: Uncaught (in promise) ReferenceError: exports is not defined Object.defineProperty(exports, "__esModule", { value: true }); ^ at file:///exports_error.js:1:23 info: Deno doesn't support CommonJS modules without `.cjs` extension. hint: Rewrite this module to ESM or change the file extension to `.cjs`. ```
2024-07-26fix: support `npm:bindings` and `npm:callsites` packages (#24727)Bartek Iwańczuk
Adds support for `npm:bindings` and `npm:callsites` packages because of changes in https://github.com/denoland/deno_core/pull/838. This `deno_core` bump causes us to stop prepending `file://` scheme for locations in stack traces that are for local files. Fixes https://github.com/denoland/deno/issues/24462 , fixes https://github.com/denoland/deno/issues/22671 , fixes https://github.com/denoland/deno/issues/15717 , fixes https://github.com/denoland/deno/issues/19130 , fixes https://github.com/WiseLibs/better-sqlite3/issues/1205 , fixes https://github.com/WiseLibs/better-sqlite3/issues/1034 , fixes https://github.com/denoland/deno/issues/20936 --------- Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
2024-02-07refactor: extract out `runtime::colors` to `deno_terminal::colors` (#22324)David Sherret
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-06chore: bump deno_core and update tests (#21467)Matt Mastracci
Landing changes required for https://github.com/denoland/deno_core/pull/359 We needed to update 99_main.js and a whole load of tests. API changes: - setPromiseRejectCallback becomes setUnhandledPromiseRejectionHandler. The function is now called from eventLoopTick. - The promiseRejectMacrotaskCallback no longer exists, as this is automatically handled in eventLoopTick. - ops.op_dispatch_exception now takes a second parameter: in_promise. The preferred way to call this op is now reportUnhandledException or reportUnhandledPromiseRejection.
2023-04-30refactor: remove ext/console/01_colors.js (#18927)Leo Kettmeir
2023-03-15refactor: remove usages of `map_or` / `map_or_else` (#18212)David Sherret
These methods are confusing because the arguments are backwards. I feel like they should have never been added to `Option<T>` and that clippy should suggest rewriting to `map(...).unwrap_or(...)`/`map(...).unwrap_or_else(|| ...)` https://github.com/rust-lang/rfcs/issues/1025
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-18chore: use Rust 1.65.0 (#16688)Aaron O'Mullan
2022-10-26feat(cli): show error cause recursion information (#16384)Cre3per
2022-09-02refactor: move JsError formatting to deno_runtime (#15345)Christian Dürr
This takes the existing `fmt_error` module from cli and puts it as a public module into `deno_runtime`.