diff --git a/packages/modules-runtime-hot/installer.js b/packages/modules-runtime-hot/installer.js index b2197fb8ea..93745f749d 100644 --- a/packages/modules-runtime-hot/installer.js +++ b/packages/modules-runtime-hot/installer.js @@ -204,17 +204,16 @@ makeInstaller = function (options) { } function makeMissingError(id) { - var path = String(id) + const path = String(id) .split('/'); - var importsFromServer = path.some(function (id) { - return id.indexOf('server') !== -1; - }); - var importsFromClient = path.some(function (id) { - return id.indexOf('client') !== -1; - }); - if (importsFromServer || importsFromClient) { + + const importsFrom = (location) => + path.some((id) => id.indexOf(location) !== -1); + + if (importsFrom('server') || importsFrom('client')) { return new Error('Cannot import module ' + id + ' \n (cross-boundary import) \n see: https://guide.meteor.com/structure.html#special-directories'); } + return new Error("Cannot find module '" + id + "'"); }