@miniflare/runner-vm
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -45,2 +45,4 @@ var __create = Object.create; | ||
return false; | ||
if (O === null) | ||
return false; | ||
const P = C.prototype; | ||
@@ -104,2 +106,3 @@ if (typeof P !== "object" && typeof P !== "function") { | ||
var import_promises = __toModule(require("fs/promises")); | ||
var import_module = __toModule(require("module")); | ||
var import_path = __toModule(require("path")); | ||
@@ -109,2 +112,3 @@ var import_vm2 = __toModule(require("vm")); | ||
var SUGGEST_BUNDLE = "If you're trying to import an npm package, you'll need to bundle your Worker first."; | ||
var SUGGEST_NODE = "If you're trying to import a Node.js built-in module, or an npm package that uses Node.js built-ins, you'll either need to:\n- Bundle your Worker, configuring your bundler to polyfill Node.js built-ins\n- Configure your bundler to load Workers-compatible builds by changing the main fields/conditions\n- Find an alternative package that doesn't require Node.js built-ins"; | ||
var ModuleLinker = class { | ||
@@ -151,4 +155,6 @@ constructor(moduleRules, additionalModules) { | ||
if (rule === void 0) { | ||
const isBuiltin = import_module.builtinModules.includes(spec); | ||
const suggestion = isBuiltin ? SUGGEST_NODE : SUGGEST_BUNDLE; | ||
throw new VMScriptRunnerError("ERR_MODULE_RULE", `${errorBase}: no matching module rules. | ||
${SUGGEST_BUNDLE}`); | ||
${suggestion}`); | ||
} | ||
@@ -202,4 +208,6 @@ const data = await import_promises.default.readFile(identifier); | ||
if (rule === void 0) { | ||
const isBuiltin = import_module.builtinModules.includes(spec); | ||
const suggestion = isBuiltin ? SUGGEST_NODE : SUGGEST_BUNDLE; | ||
throw new VMScriptRunnerError("ERR_MODULE_RULE", `${errorBase}: no matching module rules. | ||
${SUGGEST_BUNDLE}`); | ||
${suggestion}`); | ||
} | ||
@@ -206,0 +214,0 @@ this.#cjsModuleCache.set(identifier, module2); |
{ | ||
"name": "@miniflare/runner-vm", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "VM script runner module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -38,7 +38,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@miniflare/shared": "2.1.0" | ||
"@miniflare/shared": "2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@miniflare/shared-test": "2.1.0" | ||
"@miniflare/shared-test": "2.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20773
324
6
+ Added@miniflare/shared@2.2.0(transitive)
- Removed@miniflare/shared@2.1.0(transitive)
Updated@miniflare/shared@2.2.0