helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: act: Bypass microtask for "default sync" updates

When wrapping an update in act, instead of scheduling a microtask, we can add the task to our internal queue.

The benefit is that the user doesn't have to await the act call. We can flush the work synchronously. This doesn't account for microtasks that are scheduled in userspace, of course, but it at least covers React's usage.

Changed files:
filename: packages/react-reconciler/src/ReactFiberWorkLoop.new.js
patch: @@ -692,7 +692,14 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
     }
     if (supportsMicrotasks) {
       // Flush the queue in a microtask.
-      scheduleMicrotask(flushSyncCallbacks);
+      if (__DEV__ && ReactCurrentActQueue.current !== null) {
+        // Inside `act`, use our internal `act` queue so that these get flushed
+        // at the end of the current scope even when using the sync version
+        // of `act`.
+        ReactCurrentActQueue.current.push(flushSyncCallbacks);
+      } else {
+        scheduleMicrotask(flushSyncCallbacks);
+      }
     } else {
       // Flush the queue in an Immediate task.
       scheduleCallback(ImmediateSchedulerPriority, flushSyncCallbacks);

filename: packages/react-reconciler/src/ReactFiberWorkLoop.old.js
patch: @@ -692,7 +692,14 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
     }
     if (supportsMicrotasks) {
       // Flush the queue in a microtask.
-      scheduleMicrotask(flushSyncCallbacks);
+      if (__DEV__ && ReactCurrentActQueue.current !== null) {
+        // Inside `act`, use our internal `act` queue so that these get flushed
+        // at the end of the current scope even when using the sync version
+        // of `act`.
+        ReactCurrentActQueue.current.push(flushSyncCallbacks);
+      } else {
+        scheduleMicrotask(flushSyncCallbacks);
+      }
     } else {
       // Flush the queue in an Immediate task.
       scheduleCallback(ImmediateSchedulerPriority, flushSyncCallbacks);
Repository: ggml-org/llama.cpp
Pull request: SYCL: Delete redundant plus sign and space

Delete redundant plus sign and space in function ggml_sycl_mul_mat_id()

Changed files:
filename: ggml/src/ggml-sycl/ggml-sycl.cpp
patch: @@ -3113,8 +3113,8 @@ static void ggml_sycl_mul_mat_id(ggml_backend_sycl_context & ctx,
                 const int64_t i2 = i12;
 
             src0_row.data = src0_original + i02*nb02;
-            src1_row.data = src1_original + + i11*nb11 + i12*nb12;
-            dst_row.data = dst_original + i1*nb1   + i2*nb2;
+            src1_row.data = src1_original + i11*nb11 + i12*nb12;
+            dst_row.data = dst_original + i1*nb1 + i2*nb2;
 
             ggml_sycl_mul_mat(ctx, &src0_row, &src1_row, &dst_row);
             }
Repository: nodejs/node
Pull request: src: disable abort exceptions for module loading

Fixes https://github.com/nodejs/node/issues/50878.

Thanks @joyeecheung for the tip on temporarily disable `abort_on_uncaught_exception` while checking for modules.

cc @nodejs/loaders @nodejs/cpp-reviewers 

Changed files:
filename: src/node_contextify.cc
patch: @@ -1468,6 +1468,7 @@ void ContextifyContext::ContainsModuleSyntax(
       String::NewFromUtf8(isolate, "__dirname").ToLocalChecked()};
 
   TryCatchScope try_catch(env);
+  ShouldNotAbortOnUncaughtScope no_abort_scope(env);
 
   ContextifyContext::CompileFunctionAndCacheResult(env,
                                                    context,

filename: test/es-module/test-esm-detect-ambiguous.mjs
patch: @@ -235,3 +235,23 @@ describe('--experimental-detect-module', { concurrency: true }, () => {
     }
   });
 });
+
+// Validate temporarily disabling `--abort-on-uncaught-exception`
+// while running `containsModuleSyntax`.
+// Ref: https://github.com/nodejs/node/issues/50878
+describe('Wrapping a `require` of an ES module while using `--abort-on-uncaught-exception`', () => {
+  it('should work', async () => {
+    const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [
+      '--abort-on-uncaught-exception',
+      '--eval',
+      'assert.throws(() => require("./package-type-module/esm.js"), { code: "ERR_REQUIRE_ESM" })',
+    ], {
+      cwd: fixtures.path('es-modules'),
+    });
+
+    strictEqual(stderr, '');
+    strictEqual(stdout, '');
+    strictEqual(code, 0);
+    strictEqual(signal, null);
+  });
+});
Repository: denoland/deno
Pull request: fix(test): proper type checking for files with doc tests

Closes https://github.com/denoland/deno/issues/23430

Changed files:
filename: cli/tools/test/mod.rs
patch: @@ -1326,27 +1326,7 @@ pub async fn check_specifiers(
   )
   .await?;
 
-  if !inline_files.is_empty() {
-    let specifiers = inline_files
-      .iter()
-      .map(|file| file.specifier.clone())
-      .collect();
-
-    for file in inline_files {
-      file_fetcher.insert_memory_files(file);
-    }
-
-    module_load_preparer
-      .prepare_module_load(
-        specifiers,
-        false,
-        lib,
-        PermissionsContainer::new(Permissions::allow_all()),
-      )
-      .await?;
-  }
-
-  let module_specifiers = specifiers
+  let mut module_specifiers = specifiers
     .into_iter()
     .filter_map(|(specifier, mode)| {
       if mode != TestMode::Documentation {
@@ -1355,7 +1335,16 @@ pub async fn check_specifiers(
         None
       }
     })
-    .collect();
+    .collect::<Vec<_>>();
+
+  if !inline_files.is_empty() {
+    module_specifiers
+      .extend(inline_files.iter().map(|file| file.specifier.clone()));
+
+    for file in inline_files {
+      file_fetcher.insert_memory_files(file);
+    }
+  }
 
   module_load_preparer
     .prepare_module_load(

filename: tests/specs/test/type_check_with_doc/__test__.jsonc
patch: @@ -0,0 +1,5 @@
+{
+  "args": "test --doc main.ts",
+  "output": "main.out",
+  "exitCode": 1
+}

filename: tests/specs/test/type_check_with_doc/main.out
patch: @@ -0,0 +1,13 @@
+Check [WILDCARD]/main.ts
+Check [WILDCARD]/main.ts$2-5.ts
+error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
+const a: string = 1;
+      ^
+    at file://[WILDCARD]/main.ts:8:7
+
+TS2322 [ERROR]: Type 'string' is not assignable to type 'number'.
+const b: number = "1";
+      ^
+    at file://[WILDCARD]/main.ts$2-5.ts:1:7
+
+Found 2 errors.

filename: tests/specs/test/type_check_with_doc/main.ts
patch: @@ -0,0 +1,8 @@
+/**
+ * ```ts
+ * const b: number = "1";
+ * ```
+ */
+function foo() {}
+
+const a: string = 1;
Repository: facebook/react
Pull request: Pass Jest useStderr flag when debugging

This prevents it from buffering and suppressing all console logs until a test has completed running (When debugging in Chrome). This is super annoying default behavior.

Changed files:
filename: scripts/jest/jest-cli.js
patch: @@ -261,6 +261,9 @@ function getCommandArgs() {
   if (argv.debug) {
     args.unshift('--inspect-brk');
     args.push('--runInBand');
+
+    // Prevent console logs from being hidden until test completes.
+    args.push('--useStderr');
   }
 
   // CI Environments have limited workers.
Repository: nodejs/node
Pull request: doc: add write flag when open file as the demo code's intention


Changed files:
filename: doc/api/stream.md
patch: @@ -3731,7 +3731,7 @@ class WriteStream extends Writable {
     this.fd = null;
   }
   _construct(callback) {
-    fs.open(this.filename, (err, fd) => {
+    fs.open(this.filename, 'w', (err, fd) => {
       if (err) {
         callback(err);
       } else {
Repository: electron/electron
Pull request: fix: iteration issues in hid `RevokeEphemeralDevicePermission`

Backport of #42851

See that PR for details.


Notes: none


Changed files:
filename: shell/browser/hid/hid_chooser_context.cc
patch: @@ -12,6 +12,7 @@
 
 #include "base/command_line.h"
 #include "base/containers/contains.h"
+#include "base/containers/map_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
@@ -149,21 +150,18 @@ void HidChooserContext::RevokeEphemeralDevicePermission(
     const url::Origin& origin,
     const device::mojom::HidDeviceInfo& device) {
   auto it = ephemeral_devices_.find(origin);
-  if (it != ephemeral_devices_.end()) {
-    std::set<std::string>& devices = it->second;
-    for (auto guid = devices.begin(); guid != devices.end();) {
-      DCHECK(base::Contains(devices_, *guid));
-
-      if (devices_[*guid]->physical_device_id != device.physical_device_id) {
-        ++guid;
-        continue;
-      }
-
-      guid = devices.erase(guid);
-      if (devices.empty())
-        ephemeral_devices_.erase(it);
-    }
-  }
+  if (it == ephemeral_devices_.end())
+    return;
+
+  std::set<std::string>& device_guids = it->second;
+  std::erase_if(device_guids, [&](const auto& guid) {
+    auto* device_ptr = base::FindPtrOrNull(devices_, guid);
+    return device_ptr &&
+           device_ptr->physical_device_id == device.physical_device_id;
+  });
+
+  if (device_guids.empty())
+    ephemeral_devices_.erase(it);
 }
 
 bool HidChooserContext::HasDevicePermission(
Repository: denoland/deno
Pull request: fix(ext/node): check resource exists before close

The patch fixes grpc deadline example:

```sh
➜deno run -A deadline/client.js
Warning: Not implemented: Http2Session.socket
[1] wanted = OK got = OK
Warning: Not implemented: Http2Session.socket
[2] wanted = DEADLINE_EXCEEDED got = DEADLINE_EXCEEDED
Warning: Not implemented: Http2Session.socket
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bodyRid')
    at node:http2:888:96
    at eventLoopTick (ext:core/01_core.js:207:9)
```

Fixed:

```
➜  examples git:(es_examples) denod run -A deadline/client.js
Warning: Not implemented: Http2Session.socket
[1] wanted = OK got = OK
Warning: Not implemented: Http2Session.socket
[2] wanted = DEADLINE_EXCEEDED got = DEADLINE_EXCEEDED
Warning: Not implemented: Http2Session.socket
[3] wanted = OK got = OK
Warning: Not implemented: Http2Session.socket
[4] wanted = DEADLINE_EXCEEDED got = DEADLINE_EXCEEDED
Warning: Not implemented: Http2Session.socket
[5] wanted = OK got = OK
Warning: Not implemented: Http2Session.socket
[6] wanted = DEADLINE_EXCEEDED got = DEADLINE_EXCEEDED
```

I added a smoke test in the internal repo.


Changed files:
filename: ext/node/polyfills/http2.ts
patch: @@ -1015,7 +1015,7 @@ export class ClientHttp2Stream extends Duplex {
           this.emit("trailers", trailers);
         }
 
-        debugHttp2("tryClose");
+        debugHttp2(">>> tryClose", this[kDenoResponse]?.bodyRid);
         core.tryClose(this[kDenoResponse].bodyRid);
         this.push(null);
         debugHttp2(">>> read null chunk");
@@ -1246,10 +1246,12 @@ function finishCloseStream(stream, code) {
         debugHttp2(
           ">>> finishCloseStream close",
           stream[kDenoRid],
-          stream[kDenoResponse].bodyRid,
+          stream[kDenoResponse]?.bodyRid,
         );
         core.tryClose(stream[kDenoRid]);
-        core.tryClose(stream[kDenoResponse].bodyRid);
+        if (stream[kDenoResponse]) {
+          core.tryClose(stream[kDenoResponse].bodyRid);
+        }
         stream.emit("close");
       });
     });
@@ -1265,18 +1267,22 @@ function finishCloseStream(stream, code) {
         stream[kDenoResponse].bodyRid,
       );
       core.tryClose(stream[kDenoRid]);
-      core.tryClose(stream[kDenoResponse].bodyRid);
+      if (stream[kDenoResponse]) {
+        core.tryClose(stream[kDenoResponse].bodyRid);
+      }
       nextTick(() => {
         stream.emit("close");
       });
     }).catch(() => {
       debugHttp2(
         ">>> finishCloseStream close2 catch",
         stream[kDenoRid],
-        stream[kDenoResponse].bodyRid,
+        stream[kDenoResponse]?.bodyRid,
       );
       core.tryClose(stream[kDenoRid]);
-      core.tryClose(stream[kDenoResponse].bodyRid);
+      if (stream[kDenoResponse]) {
+        core.tryClose(stream[kDenoResponse].bodyRid);
+      }
       nextTick(() => {
         stream.emit("close");
       });
Repository: nodejs/node
Pull request: meta: make review-wanted message minimal

When the `review-wanted` message is sent, the ref will consistently be `refs/heads/main`, the event type will be `pull_request_target`, and I believe the most recent commit to main will likely not be relevant to the review request.

The `actions URL` is significant here, as it distinguishes this process from the force-push workflow.

Changed files:
filename: .github/workflows/notify-on-review-wanted.yml
patch: @@ -35,6 +35,7 @@ jobs:
       - name: Slack Notification
         uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907  # 2.3.0
         env:
+          MSG_MINIMAL: actions url
           SLACK_COLOR: '#3d85c6'
           SLACK_ICON: https://github.com/nodejs.png?size=48
           SLACK_TITLE: ${{ steps.define-message.outputs.title }}
Repository: ggml-org/llama.cpp
Pull request: [CANN]MUL_MAT optimization

Optimize the MUL_MAT operator for the CANN backend. When the underlying `aclnnWeightQuantBatchMatmulV2` operator is called and `k <= QK8_0`, use the `per_channel` algorithm instead of the `per_group` algorithm.

Test Cases
```
  MUL_MAT(type_a=q8_0,type_b=f32,m=16,n=1,k=32,bs=[1,1],nr=[1,1],per=[0,1,2,3]): OK
  MUL_MAT(type_a=q8_0,type_b=f32,m=16,n=1,k=256,bs=[1,1],nr=[1,1],per=[0,1,2,3]): OK
```








Changed files:
filename: ggml/src/ggml-cann/aclnn_ops.cpp
patch: @@ -2790,10 +2790,14 @@ static void ggml_cann_mul_mat_quant(ggml_backend_cann_context& ctx,
                 (char*)output_buffer + batch1 * output_stride, ACL_FLOAT16,
                 output_elem_size, output_ne, output_nb, 2, ACL_FORMAT_ND,
                 output_ne_offset);
+            int64_t antiquantGroupSize = 0;
+            if (src0->ne[0] > QK8_0) {
+                antiquantGroupSize = QK8_0;
+            }
 
             ACL_CHECK(aclnnWeightQuantBatchMatmulV2GetWorkspaceSize(
                 acl_input_tensor, acl_weight_tensor, acl_scale_tensor, nullptr,
-                nullptr, nullptr, nullptr, QK8_0, acl_output_tensor,
+                nullptr, nullptr, nullptr, antiquantGroupSize, acl_output_tensor,
                 &workspaceSize, &executor));
             if (workspaceAddr == nullptr) {
                 workspaceAddr = workspace_allocator.alloc(workspaceSize);
@@ -2833,7 +2837,7 @@ static void ggml_cann_mul_mat_quant(ggml_backend_cann_context& ctx,
 
                 ACL_CHECK(aclnnWeightQuantBatchMatmulV2GetWorkspaceSize(
                     acl_input_tensor, acl_weight_tensor, acl_scale_tensor,
-                    nullptr, nullptr, nullptr, nullptr, QK8_0,
+                    nullptr, nullptr, nullptr, nullptr, antiquantGroupSize,
                     acl_output_tensor, &workspaceSize, &executor));
                 ACL_CHECK(aclnnWeightQuantBatchMatmulV2(
                     workspaceAddr, workspaceSize, executor, ctx.stream()));

filename: ggml/src/ggml-cann/ggml-cann.cpp
patch: @@ -1689,11 +1689,6 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev,
         case GGML_OP_MUL_MAT: {
             switch (op->src[0]->type) {
                 case GGML_TYPE_Q8_0:
-                    // Current groupsize should not be greater than k-1 in
-                    // aclnnWeightQuantBatchMatmulV2GetWorkspaceSize
-                    if (op->src[0]->ne[0] <= QK8_0) {
-                        return false;
-                    }
                 case GGML_TYPE_F16:
                 case GGML_TYPE_F32:
                 case GGML_TYPE_Q4_0:
Repository: ggml-org/llama.cpp
Pull request: main : add -sysf / --system-prompt-file (#12249)

Fixes #12249

Changed files:
filename: common/arg.cpp
patch: @@ -853,6 +853,20 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
             }
         }
     ).set_excludes({LLAMA_EXAMPLE_SERVER}));
+    add_opt(common_arg(
+        {"-sysf", "--system-prompt-file"}, "FNAME",
+        "a file containing the system prompt (default: none)",
+        [](common_params & params, const std::string & value) {
+            std::ifstream file(value);
+            if (!file) {
+                throw std::runtime_error(string_format("error: failed to open file '%s'\n", value.c_str()));
+            }
+            std::copy(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>(), back_inserter(params.system_prompt));
+            if (!params.system_prompt.empty() && params.system_prompt.back() == '\n') {
+                params.system_prompt.pop_back();
+            }
+        }
+    ).set_examples({LLAMA_EXAMPLE_MAIN}));
     add_opt(common_arg(
         {"--in-file"}, "FNAME",
         "an input file (repeat to specify multiple files)",
Repository: vercel/next.js
Pull request: [dynamicIO] Avoid memory leak warning for hanging promises

Node.js tries to help you avoid memory leaks by detecting when a lot of event listeners are set for a single AbortSignal. Next.js uses abort signal listeners to do cleanup on hanging promises and so this usage is not a memory leak however to avoid creating concern amongst users we need to work around the listener count limit. This is unfortunate b/c it is otherwise useless code to add but our alternative is to turn off this leak detection or raise the limit significantly, neither of which are great options since there may be other uses where this protection is useful to our users.

In this change I implement the abort listening by a delegated event listener

Changed files:
filename: packages/next/src/server/dynamic-rendering-utils.ts
patch: @@ -20,6 +20,9 @@ class HangingPromiseRejectionError extends Error {
   }
 }
 
+type AbortListeners = Array<(err: unknown) => void>
+const abortListenersBySignal = new WeakMap<AbortSignal, AbortListeners>()
+
 /**
  * This function constructs a promise that will never resolve. This is primarily
  * useful for dynamicIO where we use promise resolution timing to determine which
@@ -31,20 +34,37 @@ export function makeHangingPromise<T>(
   signal: AbortSignal,
   expression: string
 ): Promise<T> {
-  const hangingPromise = new Promise<T>((_, reject) => {
-    signal.addEventListener(
-      'abort',
-      () => {
-        reject(new HangingPromiseRejectionError(expression))
-      },
-      { once: true }
-    )
-  })
-  // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so
-  // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct
-  // your own promise out of it you'll need to ensure you handle the error when it rejects.
-  hangingPromise.catch(ignoreReject)
-  return hangingPromise
+  if (signal.aborted) {
+    return Promise.reject(new HangingPromiseRejectionError(expression))
+  } else {
+    const hangingPromise = new Promise<T>((_, reject) => {
+      const boundRejection = reject.bind(
+        null,
+        new HangingPromiseRejectionError(expression)
+      )
+      let currentListeners = abortListenersBySignal.get(signal)
+      if (currentListeners) {
+        currentListeners.push(boundRejection)
+      } else {
+        const listeners = [boundRejection]
+        abortListenersBySignal.set(signal, listeners)
+        signal.addEventListener(
+          'abort',
+          () => {
+            for (let i = 0; i < listeners.length; i++) {
+              listeners[i]()
+            }
+          },
+          { once: true }
+        )
+      }
+    })
+    // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so
+    // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct
+    // your own promise out of it you'll need to ensure you handle the error when it rejects.
+    hangingPromise.catch(ignoreReject)
+    return hangingPromise
+  }
 }
 
 function ignoreReject() {}
Repository: electron/electron
Pull request: fix: iteration issues in hid `RevokeEphemeralDevicePermission`

#### Description of Change

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4966528

1. `it` was erased inside the cycle that was iterating over `devices`.
Since `devices` is equal to `it->second`, the condition of the for cycle
was addressing the destroyed memory, which is a potential security
issue.

2. Since `if (device_it == devices_.end())` clause didn't increase
`guid` iterator, it would cause an infinite loop if it was ever hit.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none


Changed files:
filename: shell/browser/hid/hid_chooser_context.cc
patch: @@ -12,6 +12,7 @@
 
 #include "base/command_line.h"
 #include "base/containers/contains.h"
+#include "base/containers/map_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
@@ -149,21 +150,18 @@ void HidChooserContext::RevokeEphemeralDevicePermission(
     const url::Origin& origin,
     const device::mojom::HidDeviceInfo& device) {
   auto it = ephemeral_devices_.find(origin);
-  if (it != ephemeral_devices_.end()) {
-    std::set<std::string>& devices = it->second;
-    for (auto guid = devices.begin(); guid != devices.end();) {
-      DCHECK(base::Contains(devices_, *guid));
-
-      if (devices_[*guid]->physical_device_id != device.physical_device_id) {
-        ++guid;
-        continue;
-      }
-
-      guid = devices.erase(guid);
-      if (devices.empty())
-        ephemeral_devices_.erase(it);
-    }
-  }
+  if (it == ephemeral_devices_.end())
+    return;
+
+  std::set<std::string>& device_guids = it->second;
+  std::erase_if(device_guids, [&](const auto& guid) {
+    auto* device_ptr = base::FindPtrOrNull(devices_, guid);
+    return device_ptr &&
+           device_ptr->physical_device_id == device.physical_device_id;
+  });
+
+  if (device_guids.empty())
+    ephemeral_devices_.erase(it);
 }
 
 bool HidChooserContext::HasDevicePermission(
Repository: denoland/deno
Pull request: feat(runtime): allow adding custom extensions to snapshot

This makes `create_runtime_snapshot` more useful for embedders who add their own extension(s) to the runtime in build scripts.

---

I guess the alternative would be to use the method as-is right now and then create another snapshot from that one via `startup_snapshot` of `CreateSnapshotOptions`?


Changed files:
filename: cli/build.rs
patch: @@ -346,6 +346,7 @@ fn create_cli_snapshot(snapshot_path: PathBuf) {
   deno_runtime::snapshot::create_runtime_snapshot(
     snapshot_path,
     snapshot_options,
+    vec![],
   );
 }
 

filename: runtime/snapshot.rs
patch: @@ -213,11 +213,13 @@ impl deno_kv::sqlite::SqliteDbHandlerPermissions for Permissions {
 pub fn create_runtime_snapshot(
   snapshot_path: PathBuf,
   snapshot_options: SnapshotOptions,
+  // NOTE: For embedders that wish to add additional extensions to the snapshot
+  custom_extensions: Vec<Extension>,
 ) {
   // NOTE(bartlomieju): ordering is important here, keep it in sync with
   // `runtime/worker.rs`, `runtime/web_worker.rs` and `runtime/snapshot.rs`!
   let fs = std::sync::Arc::new(deno_fs::RealFs);
-  let extensions: Vec<Extension> = vec![
+  let mut extensions: Vec<Extension> = vec![
     deno_webidl::deno_webidl::init_ops_and_esm(),
     deno_console::deno_console::init_ops_and_esm(),
     deno_url::deno_url::init_ops_and_esm(),
@@ -269,6 +271,7 @@ pub fn create_runtime_snapshot(
     ops::bootstrap::deno_bootstrap::init_ops(Some(snapshot_options)),
     ops::web_worker::deno_web_worker::init_ops(),
   ];
+  extensions.extend(custom_extensions);
 
   let output = create_snapshot(
     CreateSnapshotOptions {