Git Product home page Git Product logo

moleculer-minio's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

moleculer-minio's Issues

ERR_PACKAGE_PATH_NOT_EXPORTED

Versions

node 16.17.0
moleculer 0.14.23
minio 7.0.23

My service

const MIXIN_MINIO = require("moleculer-minio");
const MINIO_SVC = {
  name: "my_minio_svc",
  mixins: [MIXIN_MINIO],
  actions:{}
}

Error

 Failed to load service '/MY_LOCAL_PATH/minio.svc.ts' Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/errors' is not defined by "exports" in /node_modules/moleculer/package.json
at new NodeError (node:internal/errors:387:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:464:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:748:3)
    at resolveExports (node:internal/modules/cjs/loader:493:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/usr/local/lib/node_modules/ts-node/node_modules/@cspotcode/source-map-support/source-map-support.js:679:30)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'

Solution

If you change the way to import Errors from Molecuer you will resolve this problem.

    // Current import way
    const {MoleculerRetryableError} = require("moleculer/src/errors");
    // Correct way
       // Option 1
       const {MoleculerRetryableError} = require("moleculer").Errors;
       // Option 2
       const {Errors } = require("moleculer");  //Errors.MoleculerRetryableError     

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.