Skip to content

Commit 250889a

Browse files
committed
fix missing global TextEncoder when requiring jsdom
1 parent f7d7b8b commit 250889a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/browser/test/package/npm-build.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
/* eslint-disable no-console */
22
const fs = require('fs');
33
const path = require('path');
4+
const { TextEncoder } = require('util');
45

56
const webpack = require('webpack');
67
const { JSDOM } = require('jsdom');
78

9+
// This is a workaround for https://github.com/jsdom/jsdom/issues/2524
10+
global.TextEncoder = TextEncoder;
11+
812
webpack(
913
{
1014
entry: path.join(__dirname, 'test-code.js'),

0 commit comments

Comments
 (0)