Files missing in dist package
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'
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.
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",
},
...
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.