Skip to content

Commit 889f2c2

Browse files
committed
Fix: remove dynamic imports due to jest/v8 bug
1 parent fa676b4 commit 889f2c2

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

.changeset/beige-rabbits-guess.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@graphql-ez/plugin-upload': patch
3+
'@graphql-ez/plugin-websockets': patch
4+
---
5+
6+
Fix: remove dynamic imports due to jest/v8 bug, change interop method for specific problematic dependencies
7+
8+
See:
9+
10+
- https://bugs.chromium.org/p/v8/issues/detail?id=10284
11+
- https://github.com/nodejs/node/issues/36351
12+
- https://github.com/facebook/jest/issues/11438

bob-esbuild.config.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ export const config: import('bob-esbuild').BobConfig = {
1010
verbose: false,
1111
outputOptions: {
1212
sourcemap: false,
13+
interop(moduleName) {
14+
if (moduleName) {
15+
if (moduleName.startsWith('ws')) return 'esModule';
16+
17+
if (moduleName.startsWith('graphql-upload/public/')) return 'defaultOnly';
18+
}
19+
20+
return 'auto';
21+
},
1322
},
1423
esbuildPluginOptions: isHelixGraphiql
1524
? {
@@ -27,7 +36,4 @@ export const config: import('bob-esbuild').BobConfig = {
2736
})(),
2837
}
2938
: undefined,
30-
keepDynamicImport: moduleName => {
31-
return /^(ws|graphql-upload)/.test(moduleName);
32-
},
3339
};

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"typescript": ">=4.4.4",
7979
"trim@<0.0.3": ">=0.0.3",
8080
"glob-parent@<5.1.2": ">=5.1.2",
81-
"ansi-regex@>2.1.1 <5.0.1": ">=5.0.1",
8281
"set-value@<4.0.1": ">=4.0.1",
8382
"axios@<=0.21.1": ">=0.21.2"
8483
}

pnpm-lock.yaml

+6-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)