Skip to content

Commit 7d6f83d

Browse files
committed
fix(content-server): Enable esbuild-register for server-side @fxa/shared imports
Because: - content-server's server/bin and server/lib now require @fxa/shared/* modules that aren't reachable via normal node resolution. auth-server and others already run under 'node -r esbuild-register', which ships tsconfig-paths and maps those imports. content-server was starting with plain 'node ...', so the server refused to boot in CI — causing Playwright 'NS_ERROR_CONNECTION_REFUSED to http://localhost:3030/'. - Content-server's own tsconfig.json sets baseUrl to ./app/scripts for the Backbone bundle, which broke the paths resolver even with esbuild-register. TS_NODE_BASEURL=../../ pins tsconfig-paths back to the repo root at runtime without affecting the webpack build. This commit: - Adds -r esbuild-register to the pm2 startup command - Sets TS_NODE_BASEURL=../../ so @fxa/* paths resolve to libs/
1 parent e0b63a2 commit 7d6f83d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/fxa-content-server/pm2.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const apps = [];
1111

1212
apps.push({
1313
name: 'content',
14-
script: 'node --inspect=9130 server/bin/fxa-content-server.js',
14+
script:
15+
'node --inspect=9130 -r esbuild-register server/bin/fxa-content-server.js',
1516
cwd: __dirname,
1617
watch: ['server/**/*.js', 'server/**/*.html', 'server/**/*.json'],
1718
env: {
@@ -24,6 +25,7 @@ apps.push({
2425
SENTRY_DSN: process.env.SENTRY_DSN_CONTENT,
2526
TRACING_SERVICE_NAME: 'fxa-content-server',
2627
TRACING_CLIENT_NAME: 'fxa-content-client',
28+
TS_NODE_BASEURL: '../../',
2729
},
2830
});
2931

0 commit comments

Comments
 (0)