Skip to content

Commit b7d300f

Browse files
authored
Fix a situation where config files using require would not be imported as CommonJS. (#224)
1 parent 4eb7931 commit b7d300f

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vscode-apollo": patch
3+
---
4+
5+
Fix a situation where config files using `require` would not be imported as CommonJS.

src/language-server/config/loadTsConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export const loadJs: Loader = async function loadJs(filepath, contents) {
9393
if (
9494
error instanceof Error &&
9595
// [ERROR] ReferenceError: module is not defined in ES module scope
96-
error.message.includes("module is not defined")
96+
// [ERROR] ReferenceError: require is not defined in ES module scope
97+
error.message.includes("is not defined in ES module scope")
9798
) {
9899
return loadCachebustedJs(filepath, contents, "commonjs");
99100
} else {

0 commit comments

Comments
 (0)