We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please answer the following questions for yourself before submitting an issue.
Importing MoleculerRunner while having {"type": "module"} in package.json imports cjs version of MoleculerRunner.
Esm version on MoleculerRunner should be exported from "index.mjs"
Cjs version of moleculer runner is not compatible with esm project.
Create ESM project, create index.js file:
import { Runner } from 'moleculer'; const runner = new Runner(); runner.start(process.argv);
Run it.
Replacing index.mjs in moleculer repo with this fixes an issue
import mod from "./index.js"; import MoleculerRunner from './src/runner-esm.mjs'; export default mod; export const CIRCUIT_CLOSE = mod.CIRCUIT_CLOSE; export const CIRCUIT_HALF_OPEN = mod.CIRCUIT_HALF_OPEN; export const CIRCUIT_HALF_OPEN_WAIT = mod.CIRCUIT_HALF_OPEN_WAIT; export const CIRCUIT_OPEN = mod.CIRCUIT_OPEN; export const Cachers = mod.Cachers; export const Context = mod.Context; export const Discoverers = mod.Discoverers; export const Errors = mod.Errors; export const INTERNAL_MIDDLEWARES = mod.INTERNAL_MIDDLEWARES; export const Loggers = mod.Loggers; export const METRIC = mod.METRIC; export const MOLECULER_VERSION = mod.MOLECULER_VERSION; export const MetricReporters = mod.MetricReporters; export const MetricTypes = mod.MetricTypes; export const Middlewares = mod.Middlewares; export const PROTOCOL_VERSION = mod.PROTOCOL_VERSION; export const Registry = mod.Registry; export const Runner = MoleculerRunner; export const Serializers = mod.Serializers; export const Service = mod.Service; export const ServiceBroker = mod.ServiceBroker; export const Strategies = mod.Strategies; export const TracerExporters = mod.TracerExporters; export const Transit = mod.Transit; export const Transporters = mod.Transporters; export const Utils = mod.Utils; export const Validator = mod.Validator; export const Validators = mod.Validators;
The text was updated successfully, but these errors were encountered:
Good catch. The problem is that, the mjs file is generated with gen-esm-wrapper
gen-esm-wrapper
Sorry, something went wrong.
No branches or pull requests
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
Importing MoleculerRunner while having {"type": "module"} in package.json imports cjs version of MoleculerRunner.
Expected Behavior
Esm version on MoleculerRunner should be exported from "index.mjs"
Failure Information
Cjs version of moleculer runner is not compatible with esm project.
Create ESM project, create index.js file:
Run it.
Solution
Replacing index.mjs in moleculer repo with this fixes an issue
The text was updated successfully, but these errors were encountered: