# next-subproject-example

> This project aims to demonstrate how you can ship a next.js application as a node_module.

Latest version **1.1.0** (published 2020-04-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install next-subproject-example
pnpm add next-subproject-example
yarn add next-subproject-example
bun add next-subproject-example
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-04-06 |
| First published | 2020-03-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 (+10 in 1 direct dependencies) |
| Install scripts | no |
| Author | Evan Tahler |
| Maintainers | evantahler |

## Links

- npm: https://www.npmjs.com/package/next-subproject-example
- npm.io page: https://npm.io/package/next-subproject-example

## Dependencies (4)

- [next](https://npm.io/package/next.md) ^9.3.4
- [react](https://npm.io/package/react.md) ^16.13.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1
- [typescript](https://npm.io/package/typescript.md) ^3.8.3

## Recent versions

- 1.1.0 (latest) — 2020-04-06
- 1.0.0 — 2020-03-27

## README

# next-subproject-example

This project aims to demonstrate how you can ship a next.js application as a node_module.

This sample project has been published to NPM as `next-subproject-example`.

1. Make a new project with the following `package.json`, which aims to consume `next-subproject-example`

```json
{
  "name": "my-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "cd node_modules/next-subproject-example && npm run dev",
    "build": "cd node_modules/next-subproject-example && npm run prepare"
  },
  "dependencies": {
    "next-subproject-example": "latest"
  },
  "license": "ISC",
  "devDependencies": {
    "@types/node": "^13.9.5",
    "@types/react": "^16.9.26"
  }
}
```

2. `npm install`
3. `npm run dev`

See that there are errors with next building the pages as you visit http://localhost:3000

```
[ error ] ./pages/index.tsx 2:9
Module parse failed: Unexpected token (2:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export default function Index() {
>   return <h1>Hello from Next</h1>;
| }
|
```

4. `npm run build`

See similar errors

---

Observations:

- If you use `npm link` in this module and then `npm link next-subproject-example` in your project, the next project will build properly. This is not the case when installed from NPM. This is a hint that Next might need help locating the proper wepback modules.
- Switching the page from .tsx to .jsx produces the same errors

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