You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer the following questions for yourself before submitting an issue.
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
I'm reporting the issue to the correct repository
Current Behavior
When requiring the base module to setup a custom validator, node v16.14.2 throws an exception with moleculer 0.14.21:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/validators/base' is not defined by "exports" in /project/node_modules/moleculer/package.json
see below for a full log. Works correctly with moleculer 0.14.20
Expected Behavior
Should correctly require the module. For fully custom validator support we also need the following requires to work:
Welcome to Node.js v16.14.2.
Type ".help" for more information.
> const BaseValidator = require("moleculer/src/validators/base");
Uncaught:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/validators/base' is not defined by "exports" in /project/node_modules/moleculer/package.json
at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:453:9)
at packageExportsResolve (node:internal/modules/esm/resolve:731:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
The text was updated successfully, but these errors were encountered:
pibi
changed the title
ESM support break custom validator initialization
ESM support breaks custom validator initialization
Jul 19, 2022
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
When requiring the base module to setup a custom validator, node v16.14.2 throws an exception with moleculer 0.14.21:
see below for a full log. Works correctly with moleculer 0.14.20
Expected Behavior
Should correctly require the module. For fully custom validator support we also need the following requires to work:
const BaseValidator = require("moleculer/src/validators/base");
const FallbackValidator = require("moleculer/src/validators/fastest");
const {ValidationError} = require("moleculer/src/errors");
All these do not work with 0.14.21
Steps to Reproduce
With moleculer v.014.21:
Failure Logs
The text was updated successfully, but these errors were encountered: