D
Deno

help

deno runtime extensions seems to be not working

AAV62/2/2024
the example provided here https://github.com/denoland/deno/tree/main/runtime/examples/extension_with_esm seems to be not working. when the js file is executed, i get an error Error: TypeError: Deno[Deno.internal].core.opSync is not a function. what changed, i am able to register an extension with JsRuntime directly but not through workerOptions. wondering how to fix this. How do we access the extension ops from the js side in the latest version?
GitHub
deno/runtime/examples/extension_with_esm at main · denoland/deno
A modern runtime for JavaScript and TypeScript. Contribute to denoland/deno development by creating an account on GitHub.
DAHDeno AI Helper2/2/2024
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with the way you're trying to access the internal Deno core operations. The error Error: TypeError: Deno[Deno.internal].core.opSync is not a function suggests that the opSync function is not available on the object you're trying to access it from. This could be due to changes in the Deno internals or the API that might not be reflected in the example you're following. Please note that the advice I'm providing is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. It's possible that the API has changed, and the documentation or examples have not yet been updated to reflect those changes. Since you mentioned that you are able to register an extension with JsRuntime directly but not through workerOptions, it might be worth comparing the differences in how extensions are registered in both scenarios. Ensure that you're using the correct and latest API for registering extensions when working with workers. If you continue to experience issues, I recommend checking the latest Deno release notes for any changes related to runtime extensions or reaching out to the Deno community for more specific guidance.

Looking for more? Join the community!