- Bump modules-runtime version

- Add changes to history.md
This commit is contained in:
zodern
2022-02-28 15:03:32 -06:00
committed by denihs
parent 648b08d5ea
commit 28c22fafb3
3 changed files with 13 additions and 1 deletions

View File

@@ -77,6 +77,9 @@ Read our [Migration Guide](https://guide.meteor.com/2.7-migration.html) for this
* `google-oauth@1.4.2`
- Migrate from `http` to `fetch`
* `modules-runtime@0.13.0`
- Fix some npm modules being imported as an empty object. [PR](https://github.com/meteor/meteor/pull/11954), [Issue 1](https://github.com/meteor/meteor/issues/11900), [Issue 2](https://github.com/meteor/meteor/issues/11853).
#### Independent Releases
## v2.6.1, 2022-02-18

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "modules-runtime",
version: "0.12.0",
version: "0.13.0-rc270.0",
summary: "CommonJS module system",
git: "https://github.com/benjamn/install",
documentation: "README.md"

View File

@@ -51,6 +51,15 @@ Module.prototype.useNode = function () {
throw new Error('npmRequire must be defined to use useNode');
}
try {
npmRequire.resolve(this.id);
} catch (e) {
throw new Error(
`Cannot find module "${this.id}". ` +
`Try installing the npm package or make sure it is not a devDependency.`
);
}
// See tools/static-assets/server/npm-require.js for the implementation
// of npmRequire. Note that this strategy fails when importing ESM
// modules (typically, a .js file in a package with "type": "module" in