fix: suppress API/INIT and REGISTRY warnings in production

Added warning suppression at main.tsx entry point to catch
Polkadot.js warnings before any API imports load.
This commit is contained in:
2026-02-04 14:01:43 +03:00
parent db381c803d
commit c8846648ee
2 changed files with 37 additions and 10 deletions
+21
View File
@@ -1,3 +1,24 @@
// Suppress noisy Polkadot.js API warnings in production
// Must be at the very top before any imports
if (typeof window !== 'undefined' && import.meta.env.PROD) {
const originalWarn = console.warn;
const suppressedPatterns = [
'RPC methods not decorated',
'Unknown signed extensions',
'API/INIT:',
'REGISTRY:',
'StorageWeightReclaim',
];
console.warn = (...args: unknown[]) => {
const msg = String(args[0] || '');
if (suppressedPatterns.some(pattern => msg.includes(pattern))) {
return;
}
originalWarn.apply(console, args);
};
}
import { createRoot } from 'react-dom/client'
import App from './App.tsx'
import './index.css'