Skip to content

Commit

Permalink
Fix: remove dynamic imports due to jest/v8 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloSzx committed Oct 13, 2021
1 parent fa676b4 commit 1ef86a7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .changeset/beige-rabbits-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@graphql-ez/plugin-upload': patch
'@graphql-ez/plugin-websockets': patch
---

Fix: remove dynamic imports due to jest/v8 bug, change interop method for specific problematic dependencies

See:

- https://bugs.chromium.org/p/v8/issues/detail?id=10284
- https://github.com/nodejs/node/issues/36351
- https://github.com/facebook/jest/issues/11438
10 changes: 7 additions & 3 deletions bob-esbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ export const config: import('bob-esbuild').BobConfig = {
verbose: false,
outputOptions: {
sourcemap: false,
interop(moduleName) {
if (moduleName && /^(ws|graphql-upload)/.test(moduleName)) {
return 'esModule';
}

return 'auto';
},
},
esbuildPluginOptions: isHelixGraphiql
? {
Expand All @@ -27,7 +34,4 @@ export const config: import('bob-esbuild').BobConfig = {
})(),
}
: undefined,
keepDynamicImport: moduleName => {
return /^(ws|graphql-upload)/.test(moduleName);
},
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"typescript": ">=4.4.4",
"trim@<0.0.3": ">=0.0.3",
"glob-parent@<5.1.2": ">=5.1.2",
"ansi-regex@>2.1.1 <5.0.1": ">=5.0.1",
"set-value@<4.0.1": ">=4.0.1",
"axios@<=0.21.1": ">=0.21.2"
}
Expand Down
13 changes: 6 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 1ef86a7

@vercel
Copy link

@vercel vercel bot commented on 1ef86a7 Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.