Skip to content

Thrown Errors have wrong line numbers #882

Closed
@nitwhiz

Description

@nitwhiz

Expected Behaviour

any of the source-map options to tell me where errors actually happened (or throwed to be more exact)

Actual Behaviour

the lines on these error messages have some offset to their actual lines. sometimes printed line numbers are even higher than the actual LoC in the file.

tried the settings from README 1:1 and stuff like 'cheap-module-eval-source-map' and what-not as sourcemap, always an offset.

webpack.conf.js

const path = require('path');

const NodemonPlugin = require('nodemon-webpack-plugin');
const nodeExternals = require('webpack-node-externals');

module.exports = {
	target: 'node',
	entry: './src/client/cli/CLIClient.ts',
	devtool: 'cheap-module-eval-source-map',
	module: {
		rules: [
			{
				test: /\.(ts)$/,
				use: 'ts-loader',
				exclude: /node_modules/
			}
		]
	},
	resolve: {
		extensions: ['.ts', '.js'],
		alias: {
			Assets: path.resolve(__dirname, 'assets/'),
			Source: path.resolve(__dirname, 'src/')
		}
	},
	output: {
		filename: 'cli-client.js',
		path: path.resolve(__dirname, 'dist')
	},
	plugins: [new NodemonPlugin()],
	externals: [nodeExternals()]
};

error output

bildschirmfoto vom 2018-12-14 14-46-54

BattleGen1.ts

bildschirmfoto vom 2018-12-14 14-47-46

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions