# @cocalc/next

> CoCalc's nextjs server

Latest version **0.103.5** (published 2023-01-04) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @cocalc/next
pnpm add @cocalc/next
yarn add @cocalc/next
bun add @cocalc/next
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; large bundle; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.103.5 |
| Published | 2023-01-04 |
| First published | 2021-08-27 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 34 |
| Unpacked size | 107.1 MB |
| Known vulnerabilities | 0 (+20 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1289 |
| Author | SageMath, Inc. |
| Maintainers | wstein, hasch |

## Links

- npm: https://www.npmjs.com/package/@cocalc/next
- Repository: https://github.com/sagemathinc/cocalc
- Homepage: https://github.com/sagemathinc/cocalc/tree/master/src/packages/next
- Issues: https://github.com/sagemathinc/cocalc/issues
- npm.io page: https://npm.io/package/@cocalc/next

## Dependencies (34)

- [pg](https://npm.io/package/pg.md) ^8.7.1
- [antd](https://npm.io/package/antd.md) ^5.1.2
- [next](https://npm.io/package/next.md) 12.3.4
- [sha1](https://npm.io/package/sha1.md) ^1.1.1
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [react](https://npm.io/package/react.md) ^17.0.2
- [sharp](https://npm.io/package/sharp.md) ^0.30.5
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [base-64](https://npm.io/package/base-64.md) ^1.0.0
- [cookies](https://npm.io/package/cookies.md) ^0.8.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [awaiting](https://npm.io/package/awaiting.md) ^3.0.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^6.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.2
- [basic-auth](https://npm.io/package/basic-auth.md) ^2.0.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.2.10
- [typescript](https://npm.io/package/typescript.md) ^4.7.4
- [@cocalc/cdn](https://npm.io/package/@cocalc/cdn.md) ^1.15.1
- [serve-index](https://npm.io/package/serve-index.md) ^1.9.1
- [@cocalc/util](https://npm.io/package/@cocalc/util.md) ^1.76.5
- [@types/react](https://npm.io/package/@types/react.md) ^17.0.33
- [password-hash](https://npm.io/package/password-hash.md) ^1.2.2
- [timeago-react](https://npm.io/package/timeago-react.md) ^3.0.4
- [@cocalc/assets](https://npm.io/package/@cocalc/assets.md) ^1.10.1
- [@cocalc/server](https://npm.io/package/@cocalc/server.md) ^0.44.5
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.13
- [@cocalc/backend](https://npm.io/package/@cocalc/backend.md) ^1.21.1
- [@cocalc/database](https://npm.io/package/@cocalc/database.md) ^0.35.8
- [@cocalc/frontend](https://npm.io/package/@cocalc/frontend.md) ^1.102.7
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^17.0.2
- [async-await-utils](https://npm.io/package/async-await-utils.md) ^3.0.1
- [@cocalc/antd-img-crop](https://npm.io/package/@cocalc/antd-img-crop.md) ^4.5.5
- [react-google-recaptcha](https://npm.io/package/react-google-recaptcha.md) ^2.1.0
- [react-google-recaptcha-v3](https://npm.io/package/react-google-recaptcha-v3.md) ^1.9.7

## Recent versions

- 0.103.5 (latest) — 2023-01-04
- 0.78.5 (next-sso) — 2022-08-24
- 0.52.6 (range-time-5931) — 2022-05-23
- 0.49.1 (boost-dedi-5796) — 2022-05-11
- 0.35.0 (pr-5723) — 2022-03-06
- 0.103.4 — 2023-01-03
- 0.103.3 — 2023-01-03
- 0.103.2 — 2023-01-03
- 0.103.0 — 2023-01-02
- 0.102.0 — 2023-01-02
- 0.101.0 — 2023-01-02
- 0.100.4 — 2022-12-20
- 0.100.3 — 2022-12-20
- 0.100.2 — 2022-12-07
- 0.100.0 — 2022-12-07
- … 212 more at https://npm.io/package/@cocalc/next/versions

## README

# The Next.js Server

## Upgrades

**IMPORTANT:** When upgrading the `next` package, always do this:

```sh
npm install -E next@latest  # note the -E!
```

This ensures that the version of next on the build machine when making the npm package is the same as the version on the server when you deploy it! I've been bitten by messing this up _multiple times._ The problem is:

1. Upgrade next, e.g., to version 12.1.5, say, so it says `^12.1.5` in package.json
2. Build and deploy npm module using next 12.1.5.
3. Install it on the server a day later... and it goes BOOM and totally break!
4. Why?  Because the server has next 12.1.6 installed, due to semver.  However, and this is important, **nextjs's** build has absolutely no respect for semver.

## Overview

This is a next.js app, which is used as part of CoCalc to provide the landing page and the share server.

To develop this, mostly just edit code here and it will automatically reload (hot module reloading) without you having to refresh the page.  As long as you're not changing basic configuration, you don't have to restart the server.

You don't **need** to start your own nextjs server here -- the hub handles that.  That said, you can, especially for debugging purposes -- see `package.json` .

## The Landing Page

The landing page is `pages/index.tsx`.

## The Share Server

The paths for the share server are in `pages/share`.  Also see `lib/share` and `components/share` for code specific to the share server.

---
_Source: https://npm.io/package/@cocalc/next · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
