Skip to content

Commit

Permalink
Fix typescript 4.6.2 randomUUID() (#34976)
Browse files Browse the repository at this point in the history
This PR fixes the latest version of `typescript` (4.6.2) that was failing with the following:

```
Type error: Overload signatures must all be optional or required.
  207 |       array: T
  208 |     ): T
> 209 |     randomUUID?(): string
      |     ^
  210 |   }
  211 | }
```

https://github.com/vercel/next.js/runs/5376232868?check_suite_focus=true#step:8:106

- Related to PeculiarVentures/webcrypto#44

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
  • Loading branch information
styfle and ijjk committed Mar 2, 2022
1 parent e3d0d64 commit 937ab16
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 33 deletions.
14 changes: 10 additions & 4 deletions packages/next/compiled/@peculiar/webcrypto/webcrypto.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/package.json
Expand Up @@ -122,7 +122,7 @@
"@next/react-dev-overlay": "12.1.1-canary.6",
"@next/react-refresh-utils": "12.1.1-canary.6",
"@next/swc": "12.1.1-canary.6",
"@peculiar/webcrypto": "1.1.7",
"@peculiar/webcrypto": "1.3.1",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/types/index.d.ts
Expand Up @@ -206,7 +206,7 @@ declare global {
>(
array: T
): T
randomUUID?(): string
randomUUID(): string
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/production/middleware-typescript/test/index.test.ts
Expand Up @@ -18,7 +18,7 @@ describe('should set-up next', () => {
'next.config.js': new FileRef(join(appDir, 'next.config.js')),
},
dependencies: {
typescript: '4.4.3',
typescript: 'latest',
'@types/node': 'latest',
'@types/react': 'latest',
'@types/react-dom': 'latest',
Expand Down
2 changes: 1 addition & 1 deletion test/production/typescript-basic/index.test.ts
Expand Up @@ -24,7 +24,7 @@ describe('TypeScript basic', () => {
`,
},
dependencies: {
typescript: '4.4.3',
typescript: 'latest',
'@types/node': 'latest',
'@types/react': 'latest',
'@types/react-dom': 'latest',
Expand Down
63 changes: 38 additions & 25 deletions yarn.lock
Expand Up @@ -4277,14 +4277,14 @@
"@octokit/openapi-types" "^4.0.2"
"@types/node" ">= 8"

"@peculiar/asn1-schema@^2.0.32", "@peculiar/asn1-schema@^2.0.38":
version "2.0.38"
resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.0.38.tgz#98b6f12daad275ecd6774dfe31fb62f362900412"
integrity sha512-zZ64UpCTm9me15nuCpPgJghSdbEm8atcDQPCyK+bKXjZAQ1735NCZXCSCfbckbQ4MH36Rm9403n/qMq77LFDzQ==
"@peculiar/asn1-schema@^2.0.44":
version "2.0.44"
resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.0.44.tgz#dcb1b8f84a4dd5f07f674028beade9c3de43cc06"
integrity sha512-uaCnjQ9A9WwQSMuDJcNOCYEPXTahgKbFMvI7eMOMd8lXgx0J1eU7F3BoMsK5PFxa3dVUxjSQbaOjfgGoeHGgoQ==
dependencies:
"@types/asn1js" "^2.0.2"
asn1js "^2.1.1"
pvtsutils "^1.2.0"
pvtsutils "^1.2.1"
tslib "^2.3.0"

"@peculiar/json-schema@^1.1.12":
Expand All @@ -4294,16 +4294,16 @@
dependencies:
tslib "^2.0.0"

"@peculiar/webcrypto@1.1.7":
version "1.1.7"
resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.1.7.tgz#ff02008612e67ab7cc2a92fce04a7f0e2a04b71c"
integrity sha512-aCNLYdHZkvGH+T8/YBOY33jrVGVuLIa3bpizeHXqwN+P4ZtixhA+kxEEWM1amZwUY2nY/iuj+5jdZn/zB7EPPQ==
"@peculiar/webcrypto@1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.3.1.tgz#cd152b5d41841b4296983425fbeb9defb085bb0a"
integrity sha512-BdzqCnzquMaoPYsFqWP/Q8SNslweb6A+oVaVbt9JBuXuvb528CEDUGVA0NSEZrgXj8jt++2kx3anChiKhOV3Nw==
dependencies:
"@peculiar/asn1-schema" "^2.0.32"
"@peculiar/asn1-schema" "^2.0.44"
"@peculiar/json-schema" "^1.1.12"
pvtsutils "^1.1.6"
tslib "^2.2.0"
webcrypto-core "^1.2.0"
pvtsutils "^1.2.2"
tslib "^2.3.1"
webcrypto-core "^1.6.0"

"@polka/url@^1.0.0-next.9":
version "1.0.0-next.11"
Expand Down Expand Up @@ -5535,6 +5535,11 @@
"@typescript-eslint/types" "5.0.0"
eslint-visitor-keys "^3.0.0"

"@typescript/lib-dom@npm:@types/web":
version "0.0.53"
resolved "https://registry.yarnpkg.com/@types/web/-/web-0.0.53.tgz#d413ced7b3437b028dcf021c035dd1cb83233ada"
integrity sha512-ULJJgHevSiiD/QaSWcpAfWHXHEaeXUXGGJ82XVderV4TAWdI22NFyjWcRfzJwjEIdUi0gvfVRlTFDeLTZpvF4Q==

"@vercel/fetch-cached-dns@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@vercel/fetch-cached-dns/-/fetch-cached-dns-2.0.2.tgz#975c395cf53f188fa618fad57f27af6b5ffc5bab"
Expand Down Expand Up @@ -6409,6 +6414,13 @@ asn1js@^2.1.1:
dependencies:
pvutils latest

asn1js@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-2.2.0.tgz#d890fcdda86b8a005693df14a986bfb2c2069c57"
integrity sha512-oagLNqpfNv7CvmyMoexMDNyVDSiq1rya0AEUgcLlNHdHgNl6U/hi8xY370n5y+ZIFEXOx0J4B1qF2NDjMRxklA==
dependencies:
pvutils latest

assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
Expand Down Expand Up @@ -17400,12 +17412,12 @@ purgecss@^1.4.0:
postcss-selector-parser "^6.0.0"
yargs "^14.0.0"

pvtsutils@^1.1.6, pvtsutils@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.2.0.tgz#619e4767093d23cd600482600c16f4c36d3025bb"
integrity sha512-IDefMJEQl7HX0FP2hIKJFnAR11klP1js2ixCrOaMhe3kXFK6RQ2ABUCuwWaaD4ib0hSbh2fGTICvWJJhDfNecA==
pvtsutils@^1.2.1, pvtsutils@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.2.2.tgz#62ef6bc0513cbc255ee02574dedeaa41272d6101"
integrity sha512-OALo5ZEdqiI127i64+CXwkCOyFHUA+tCQgaUO/MvRDFXWPr53f2sx28ECNztUEzuyu5xvuuD1EB/szg9mwJoGA==
dependencies:
tslib "^2.2.0"
tslib "^2.3.1"

pvutils@latest:
version "1.0.17"
Expand Down Expand Up @@ -21141,15 +21153,16 @@ web-vitals@2.1.0:
resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-2.1.0.tgz#ebf5428875ab5bfc1056c2e80cd177001287de7b"
integrity sha512-npEyJP8jHf3J71t1tRTEtz9FeKp8H2udWJUUq5ykfPhhstr//TUxiYhIEzLNwk4zv2ybAilMn7v7N6Mxmuitmg==

webcrypto-core@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.2.1.tgz#33f451a4c4faf159e74589436c80ca33998abad6"
integrity sha512-5+h1/e/A4eegCRTg+oQ9ehTJRTMwFhZazJ2RH1FP0VC3q1/0xl7x6SzzTwPxd/VTGc7kjuSEJGnfNgoLe5jNRQ==
webcrypto-core@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.6.0.tgz#46a8c09ebf8efada148c60f9e747c8c3d1e844d3"
integrity sha512-jBBhCjNrdqp2iMtbxiHPtBSWvBt/gxmtV6AfaQ/tWopxKX79WBUoydamDFObPsUIR7F3vLRJwCKCBLkCEpGe3A==
dependencies:
"@peculiar/asn1-schema" "^2.0.38"
"@peculiar/asn1-schema" "^2.0.44"
"@peculiar/json-schema" "^1.1.12"
asn1js "^2.1.1"
pvtsutils "^1.2.0"
"@typescript/lib-dom" "npm:@types/web"
asn1js "^2.2.0"
pvtsutils "^1.2.2"
tslib "^2.3.1"

webidl-conversions@^3.0.0:
Expand Down

0 comments on commit 937ab16

Please sign in to comment.