logger-node icon indicating copy to clipboard operation
logger-node copied to clipboard

Files missing in dist package

Open SntsDev opened this issue 1 year ago • 3 comments

When compiling TSC writes the following errors:

WARNING in ../../node_modules/@logdna/logger/node_modules/agent-base/dist/helpers.js
Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/zzz/node_modules/@logdna/logger/node_modules/agent-base/src/helpers.ts' file: Error: ENOENT: no such file or directory, open '/zzz/node_modules/@logdna/logger/node_modules/agent-base/src/helpers.ts'

WARNING in ../../node_modules/@logdna/logger/node_modules/agent-base/dist/index.js
Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/zzz/node_modules/@logdna/logger/node_modules/agent-base/src/index.ts' file: Error: ENOENT: no such file or directory, open '/zzz/node_modules/@logdna/logger/node_modules/agent-base/src/index.ts'

WARNING in ../../node_modules/@logdna/logger/node_modules/https-proxy-agent/dist/index.js
Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/zzz/node_modules/@logdna/logger/node_modules/https-proxy-agent/src/index.ts' file: Error: ENOENT: no such file or directory, open '/zzz/node_modules/@logdna/logger/node_modules/https-proxy-agent/src/index.ts'

WARNING in ../../node_modules/@logdna/logger/node_modules/https-proxy-agent/dist/parse-proxy-response.js
Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/zzz/node_modules/@logdna/logger/node_modules/https-proxy-agent/src/parse-proxy-response.ts' file: Error: ENOENT: no such file or directory, open '/zzz/node_modules/@logdna/logger/node_modules/https-proxy-agent/src/parse-proxy-response.ts'

SntsDev avatar Aug 28 '24 15:08 SntsDev

Thank you for opening this. Can you provide a code snippet that triggers these warnings? This is ultimately a CommonJS project and a typescript definition was provided as best we could. The dependencies of logger-node might not support the code you're writing, as it appears it's trying to pull type defs from those packages as well.

darinspivey avatar Aug 28 '24 18:08 darinspivey

It's a Nx project. We use a custom Webpack config file:

...
    output: {
      filename: `[name].js`,
      path: path.resolve(config.output.path),
      library: {
        name: "handler",
        type: "commonjs",
        export: "default",
      },
      environment: {
        globalThis: false,
        module: true,
      },
    },
    target: "node",
    optimization: {
      usedExports: true,
      sideEffects: true,
      innerGraph: true,
      minimize: modeConfiguration === "production",
    },
...

SntsDev avatar Aug 29 '24 09:08 SntsDev

Thanks, but that's not much help as it relates to this project. This appears to be an Nx configuration issue with it treating logging-node's dependencies as modules, and those deps are out of our control.

Also, the logs show that these are WARNING not errors, so I'm curious if they're hard failures? At this point, I'm not sure our team will be much help in solving this one. If you can prove this is the fault of logger-node, then we'd be happy to help.

darinspivey avatar Aug 29 '24 16:08 darinspivey