Skip to content

Commit 360dd5a

Browse files
committed
buffer fix
1 parent d016714 commit 360dd5a

File tree

5 files changed

+1659
-1639
lines changed

5 files changed

+1659
-1639
lines changed

dist/assets/index-BGCWMan1.js

Lines changed: 0 additions & 1638 deletions
This file was deleted.

dist/assets/index-D2e9LQWo.js

Lines changed: 1643 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>Demo Dapp with @tonconnect/ui-react</title>
99

1010
<script data-consolejs-channel="57e95ad4-4a89-7cf9-106a-51106eb4d73d" src="https://remotejs.com/agent/agent.js"></script>
11-
<script type="module" crossorigin src="/demo-dapp-with-wallet/relayers/assets/index-BGCWMan1.js"></script>
11+
<script type="module" crossorigin src="/demo-dapp-with-wallet/relayers/assets/index-D2e9LQWo.js"></script>
1212
<link rel="stylesheet" crossorigin href="/demo-dapp-with-wallet/relayers/assets/index-C6qF6Nog.css">
1313
</head>
1414
<body>

src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import './polyfills'
12
import './patch-local-storage-for-github-pages';
23

34
import React from 'react';

src/polyfills.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Гарантируем глобальный Buffer/alloc и др. методы в браузере
2+
import { Buffer as BufferPolyfill } from 'buffer'
3+
import process from 'process'
4+
5+
const g: any = globalThis as any
6+
7+
if (!g.Buffer || typeof g.Buffer.alloc !== 'function') {
8+
g.Buffer = BufferPolyfill
9+
}
10+
11+
// если нужен process.env и т.п. (безопасно оставить)
12+
if (!g.process) {
13+
g.process = process
14+
}

0 commit comments

Comments
 (0)