Skip to content

Commit

Permalink
fix: Add support for Node 18 (#5656)
Browse files Browse the repository at this point in the history
* add support for Node 18

* update node engines in packages/next-auth

Co-authored-by: Thang Vu <hi@thvu.dev>
  • Loading branch information
ncmbch and ThangHuuVu committed Oct 31, 2022
1 parent 777da43 commit 30ad639
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/version-pr/action.yml
Expand Up @@ -4,5 +4,5 @@ outputs:
version:
description: "npm package version"
runs:
using: "node16"
using: "node18"
main: "index.js"
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
16
18
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -41,7 +41,7 @@ corepack enable pnpm

(Now, if you run `pnpm --version`, it should print the same verion as the `packageManager` property in the [`package.json` file](https://github.com/nextauthjs/next-auth/blob/main/package.json))

3. Install packages. Developing requires Node.js v16:
3. Install packages. Developing requires Node.js v18:

```sh
pnpm install
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorials/corporate-proxy.md
Expand Up @@ -3,7 +3,7 @@ id: corporate-proxy
title: Add support for HTTP Proxy
--

Using NextAuth.js behind a corporate proxy is not supported out of the box. This is due to the fact that the underlying library we use, [`openid-client`](https://npm.im/openid-client), uses the built-in Node.js `http` / `https` libraries, which do not support proxys by default. (See: [`http` docs](https://nodejs.org/dist/latest-v16.x/docs/api/http.html), [`https` docs](https://nodejs.org/dist/latest-v16.x/docs/api/https.html)).
Using NextAuth.js behind a corporate proxy is not supported out of the box. This is due to the fact that the underlying library we use, [`openid-client`](https://npm.im/openid-client), uses the built-in Node.js `http` / `https` libraries, which do not support proxys by default. (See: [`http` docs](https://nodejs.org/dist/latest-v18.x/docs/api/http.html), [`https` docs](https://nodejs.org/dist/latest-v18.x/docs/api/https.html)).

Therefore, we'll need to an additional proxy agent to the http client, such as `https-proxy-agent`. `openid-client` allows the user to set an `agent` for requests ([Source](https://github.com/panva/node-openid-client/blob/main/docs/README.md#customizing-individual-http-requests).

Expand Down
@@ -1,8 +1,8 @@
# Corporate proxy

Using NextAuth.js behind a corporate proxy is not supported out of the box. This is due to the fact that the underlying library we use, [`openid-client`](https://npm.im/openid-client) which uses the built-in Node.js `http` / `https` libraries, and those do not support proxys by default:
- [`http` docs](https://nodejs.org/dist/latest-v16.x/docs/api/http.html)
- [`https` docs](https://nodejs.org/dist/latest-v16.x/docs/api/https.html)
- [`http` docs](https://nodejs.org/dist/latest-v18.x/docs/api/http.html)
- [`https` docs](https://nodejs.org/dist/latest-v18.x/docs/api/https.html)

Therefore, we'll need to add an additional proxy agent to the http client, such as `https-proxy-agent`.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -40,7 +40,7 @@
"typescript": "4.8.4"
},
"engines": {
"node": "^12.19.0 || ^14.15.0 || ^16.13.0"
"node": "^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0"
},
"prettier": {
"semi": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-auth/package.json
Expand Up @@ -129,6 +129,6 @@
"whatwg-fetch": "^3.6.2"
},
"engines": {
"node": "^12.19.0 || ^14.15.0 || ^16.13.0"
"node": "^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0"
}
}

1 comment on commit 30ad639

@vercel
Copy link

@vercel vercel bot commented on 30ad639 Oct 31, 2022

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.