From 8ef129bd3d764084c95ee22e9847d838227cae60 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 21 Jan 2026 17:46:54 +0000 Subject: [PATCH] fix: add import assertion for JSON imports in ESM Adds 'with { type: "json" }' to JSON imports to fix Node.js ESM runtime error: ERR_IMPORT_ATTRIBUTE_MISSING --- src/Defaults/index.ts | 2 +- src/Utils/generics.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Defaults/index.ts b/src/Defaults/index.ts index 3db088f4..846a8108 100644 --- a/src/Defaults/index.ts +++ b/src/Defaults/index.ts @@ -4,7 +4,7 @@ import type { AuthenticationState, SocketConfig, WAVersion } from '../Types' import { Browsers } from '../Utils/browser-utils' import logger from '../Utils/logger' // Single source of truth for WhatsApp Web version - imported from JSON -import baileysVersionData from './baileys-version.json' +import baileysVersionData from './baileys-version.json' with { type: 'json' } const version = baileysVersionData.version diff --git a/src/Utils/generics.ts b/src/Utils/generics.ts index 9c53b822..ce0a69c8 100644 --- a/src/Utils/generics.ts +++ b/src/Utils/generics.ts @@ -2,7 +2,7 @@ import { Boom } from '@hapi/boom' import { createHash, randomBytes } from 'crypto' import { proto } from '../../WAProto/index.js' // Single source of truth for WhatsApp Web version - imported from JSON -import baileysVersionData from '../Defaults/baileys-version.json' +import baileysVersionData from '../Defaults/baileys-version.json' with { type: 'json' } const baileysVersion = baileysVersionData.version import type {