diff --git a/.changeset/evil-words-taste.md b/.changeset/evil-words-taste.md new file mode 100644 index 000000000..117eec41e --- /dev/null +++ b/.changeset/evil-words-taste.md @@ -0,0 +1,15 @@ +--- +"@opennextjs/cloudflare": patch +--- + +fix(tsconfig): make tsconfig files compatible with TypeScript 6.0 + +This change updates tsconfig files to fix the following TypeScript 6.0 errors: + +```text +Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + Visit https://aka.ms/ts6 for migration information. + +The common source directory of 'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout. + Visit https://aka.ms/ts6 for migration information. +``` diff --git a/examples/common/tsconfig.json b/examples/common/tsconfig.json index f30272bf7..87f9e73e3 100644 --- a/examples/common/tsconfig.json +++ b/examples/common/tsconfig.json @@ -8,7 +8,7 @@ "incremental": true, "module": "esnext", "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true } diff --git a/examples/middleware/tsconfig.json b/examples/middleware/tsconfig.json index 32f841eaa..62ed918e3 100755 --- a/examples/middleware/tsconfig.json +++ b/examples/middleware/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "esnext", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -9,7 +9,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/examples/next-partial-prerendering/tsconfig.json b/examples/next-partial-prerendering/tsconfig.json index fe9541f2c..1279e44e7 100755 --- a/examples/next-partial-prerendering/tsconfig.json +++ b/examples/next-partial-prerendering/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "esnext", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -9,12 +9,11 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "incremental": true, - "baseUrl": ".", "paths": { "#/*": ["./*"] }, diff --git a/examples/playground14/tsconfig.json b/examples/playground14/tsconfig.json index e6328fd10..4133edb5c 100644 --- a/examples/playground14/tsconfig.json +++ b/examples/playground14/tsconfig.json @@ -8,7 +8,7 @@ "incremental": true, "module": "esnext", "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/examples/playground15/tsconfig.json b/examples/playground15/tsconfig.json index 3d7135586..b0ab65240 100644 --- a/examples/playground15/tsconfig.json +++ b/examples/playground15/tsconfig.json @@ -8,7 +8,7 @@ "incremental": true, "module": "esnext", "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/packages/cloudflare/tsconfig.json b/packages/cloudflare/tsconfig.json index 48f1af14f..933074eac 100644 --- a/packages/cloudflare/tsconfig.json +++ b/packages/cloudflare/tsconfig.json @@ -7,11 +7,12 @@ "exactOptionalPropertyTypes": false, "forceConsistentCasingInFileNames": true, "lib": ["ESNext"], - "module": "ESNext", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "nodenext", "noImplicitReturns": false, "noPropertyAccessFromIndexSignature": false, "resolveJsonModule": true, + "rootDir": "./src", "outDir": "./dist", "target": "ES2022", "types": ["@cloudflare/workers-types", "@opennextjs/aws/types/global.d.ts"]