Skip to content

Commit

Permalink
Merge pull request #1685 from compdemocracy/typescript-line-numbers
Browse files Browse the repository at this point in the history
Fixed: TypeScript linenumbers on server stacktraces
  • Loading branch information
ballPointPenguin committed Jun 12, 2023
2 parents 15dcbf7 + 2e4a726 commit 5a31d46
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 12 deletions.
60 changes: 49 additions & 11 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"response-time": "~2.3.1",
"simple-oauth2": "~0.2.1",
"sql": "~0.34.0",
"source-map-support": "~0.5.21",
"underscore": "~1.12.1",
"valid-url": "~1.0.9",
"winston": "~3.8.2"
Expand All @@ -79,6 +80,7 @@
"@types/replacestream": "~4.0.0",
"@types/request-promise": "4.1.48",
"@types/response-time": "~2.3.4",
"@types/source-map-support": "~0.5.6",
"@types/supertest": "^2.0.12",
"@types/underscore": "~1.11.1",
"@types/valid-url": "~1.0.3",
Expand Down
4 changes: 4 additions & 0 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const prodHostname = process.env.API_PROD_HOSTNAME || "pol.is";
const serverPort = parseInt(process.env.API_SERVER_PORT || process.env.PORT || "5000", 10) as number;
const shouldUseTranslationAPI = isTrue(process.env.SHOULD_USE_TRANSLATION_API) as boolean;

import('source-map-support').then((sourceMapSupport) => {
sourceMapSupport.install();
});

export default {
domainOverride: domainOverride as string | null,
isDevMode: devMode as boolean,
Expand Down
2 changes: 1 addition & 1 deletion server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./dist/app.js" /* Concatenate and emit output to single file. */,
"outDir": "./dist" /* Redirect output structure to the directory. */,
"rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
Expand Down

0 comments on commit 5a31d46

Please sign in to comment.