Closed wirwolf closed 5 years ago
@Eywek
I build project by Webpack after fix this issue i can see next error
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Object.dirname (path.js:1260:5)
at Function.findPackageJson (/app/dist/webpack:/node_modules/@pm2/io/build/main/configuration.js:24:1)
at Function.init (/app/dist/webpack:/node_modules/@pm2/io/build/main/configuration.js:44:1)
at PMX.init (/app/dist/webpack:/node_modules/@pm2/io/build/main/pmx.js:87:1)
at new Pmx (/app/dist/webpack:/Modules/Pmx/index.ts:11:26)
at Object../index.ts (/app/dist/webpack:/index.ts:33:13)
at __webpack_require__ (/app/dist/webpack:/webpack/bootstrap:19:1)
at /app/dist/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/app/dist/app.js:87:10)
require.main.filename = undefined when i run compile code. Wen i use ts-node all work is normal
Why do you try to use webpack instead of tsc
?
I use webpack to build my project in one is file
@wirwolf do you mind sharing the webpack config you used ? did you end up having multiple entry points ? (as Daemon is loaded dynamically ?)
@Eywek any idea on when this is going to be released ?
@Eywek thanks for releasing the 4.2.6 version ... the npm version is still 4.2.5 though ... are you planning to publish 4.2.6 soon ?
Done, we were experiencing troubles with the CI.
@ahmedkotb
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const TSConfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const context = path.resolve(__dirname, 'src');
module.exports = {
context,
mode: "development",
entry: getEntryPoints(),
output: {
filename: '[name].js',
path: path.resolve(__dirname , 'dist')
},
resolve: {
extensions: ['.ts', '.js', '.node', '.json'],
modules: ['node_modules', path.resolve(__dirname, 'src')],
alias: {
hiredis: path.resolve(__dirname, 'alias', 'hiredis.js'),
},
plugins: [
new TSConfigPathsPlugin({
configFile: "./tsconfig.json",
logLevel: "info",
extensions: [".ts", ".tsx"]
})
]
},
externals: ['node_modules'],
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(__dirname, 'tsconfig.json')
},
exclude: [/node_modules/, path.resolve('dist')]
},
{
test: /\.node$/,
loader: 'node-loader'
},
]
},
target: 'node',
devtool: "source-map",
// plugins: [
// new CleanWebpackPlugin(path.resolve(__dirname, 'dist')),
// ],
stats: {
colors: true,
warnings: false
}
};
function getEntryPoints() {
// const fs = require('fs');
// let modules = fs.readdirSync(path.resolve(context, 'modules'));
let result = {
App: './App.ts',
};
// modules.forEach((module) => result[module] = `./modules/${module}/index.ts`);
return result;
}
packege.json