Skip to content

Commit f131df3

Browse files
committed
fix(networks): fix networks build issue - this fix is temporarly and will be using the logger package instead
1 parent c16bc5d commit f131df3

File tree

4 files changed

+460
-962
lines changed

4 files changed

+460
-962
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,7 @@ lit-cache
9090
lit-auth-local
9191
artillery-state.json
9292
artillery-pkp-tokens
93-
lit-auth-artillery
93+
lit-auth-artillery
94+
alice-auth-manager-data
95+
96+
.plans

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"scripts": {
66
"reset": "rimraf dist pnpm-lock.yaml node_modules tmp yarn-error.log yarn.lock package-lock.json learn-debug.log .nx lit-auth-storage pkp-tokens lit-auth-local ./e2e/dist ./e2e/node_modules",
7-
"build": "nx run-many --parallel=false --target=build --all --exclude=wrapped-keys,wrapped-keys-lit-actions && npm run prettier",
7+
"build": "nx run-many --parallel=false --target=build --all --exclude=wrapped-keys,wrapped-keys-lit-actions",
88
"build:affected": "nx affected --target=build --exclude=wrapped-keys,wrapped-keys-lit-actions",
99
"check-deps": "npx nx run-many --target=check-deps --exclude=wrapped-keys,wrapped-keys-lit-actions",
1010
"validate": "npm run check-deps && npm run build",

packages/networks/src/networks/shared/logger.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ async function tryEnhanceLoggerForNode() {
4444
if (isNodeEnvironment) {
4545
try {
4646
// Dynamically import pino-caller. This prevents it from being in browser bundles.
47-
const pinoCallerModule = await import('pino-caller');
48-
// Handle potential differences in how CJS modules are exposed via dynamic import
49-
const pinoCallerWrapper = pinoCallerModule.default || pinoCallerModule;
47+
const pinoCallerModule: any = await import('pino-caller');
48+
// Handle potential differences in how CJS modules are exposed via dynamic import and avoid type mismatches
49+
const pinoCallerWrapper: (logger: any) => any =
50+
(pinoCallerModule && (pinoCallerModule.default || pinoCallerModule)) ||
51+
((l: any) => l);
5052

5153
// Create a new pino instance specifically for pino-caller to wrap.
5254
// This ensures pino-caller operates on a logger with the correct Node.js settings.
5355
const nodeBaseLogger = pino({ level: getLogLevel() });
54-
logger = pinoCallerWrapper(nodeBaseLogger); // Reassign the exported logger
56+
logger = pinoCallerWrapper(nodeBaseLogger) as unknown as PinoLogger; // Reassign the exported logger
5557
} catch (e) {
5658
// If pino-caller fails to load, the basic pino logger for Node.js (already set) will be used.
5759
// You could add a log message here if desired, e.g., using console.error

0 commit comments

Comments
 (0)