Skip to content

Can't build with webpack #169

@diogosantosmendes

Description

@diogosantosmendes

I'm trying to build my project with @msgpack/msgpack@2.5.1 and that is not possible (error log bellow),

when I downgrade to version 2.2.1 it works again, do you understand why is that?

Can't import the named export '__asyncGenerator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs 12:11-27
Can't import the named export '__asyncGenerator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 142:35-48
Can't import the named export '__asyncValues' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 213:35-48
Can't import the named export '__asyncValues' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 215:49-56
Can't import the named export '__await' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 234:45-52
Can't import the named export '__await' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 261:45-52
Can't import the named export '__await' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs 24:41-48
Can't import the named export '__await' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs 28:41-48
Can't import the named export '__await' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs 32:41-48
Can't import the named export '__await' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs 7:11-20
Can't import the named export '__awaiter' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 133:15-24
Can't import the named export '__awaiter' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 32:4-13
Can't import the named export '__extends' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs 9:15-26
Can't import the named export '__generator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 114:15-26
Can't import the named export '__generator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 135:19-30
Can't import the named export '__generator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs 205:19-30
Can't import the named export '__generator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts

ERROR in ./node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs 14:15-26
Can't import the named export '__generator' from non EcmaScript module (only default export is available)
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs
 @ ./node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs
 @ ./src/services/helpers/rabbitmq.ts
 @ ./src/index.ts
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! cma-sidecar@2.1.0 build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the cma-sidecar@2.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-07T16_47_29_571Z-debug.log

and here is my webpack config:

const { NODE_ENV = "production" } = process.env;
module.exports = {
  entry: path.resolve(__dirname, "src", "index.ts"),
  mode: NODE_ENV,
  target: "node",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "bundle.js",
  },
  resolve: {
    extensions: [".ts", ".js"],
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: ["ts-loader"],
      },
    ],
  },
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions