FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Docs: Update developing.md to recommend running pnpm build before pnpm dev on a fresh clone · Issue #97506 · vercel/next.js · GitHub

/ next.js Public

Docs: Update developing.md to recommend running pnpm build before pnpm dev on a fresh clone #97506

Description

What is the documentation issue?

I think the guide in the developing.md file—specifically the Local Development section—is not very reliable.

Is there any context that might help us understand?

Why does pnpm dev fail on a fresh clone (I used this command: git clone --depth 1 --single-branch), and does the development.md documentation need to be updated to recommend running pnpm build first? Because if I run pnpm dev directly, an error appears in my terminal:

abdian@abdian:~/contribution-to-oss/next.js$ pnpm dev

> nextjs-project@0.0.0 dev /home/abdian/contribution-to-oss/next.js
> turbo run dev --parallel --filter="!@next/bundle-analyzer-ui"

 WARNING  --parallel is deprecated and will be removed in a future major version. Instead, define task behavior in your turbo.json task definitions using `persistent` and `with`.

Attention:
Turborepo now collects completely anonymous telemetry regarding usage.      
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turborepo.dev/docs/telemetry

• turbo 2.9.4

   • Packages in scope: @next/bundle-analyzer, @next/codemod, @next/env, @next/eslint-plugin-internal, @next/eslint-plugin-next, @next/font, @next/mdx, @next/playwright, @next/plugin-storybook, @next/polyfill-module, @next/polyfill-nomodule, @next/react-refresh-utils, @next/routing, @next/swc, @next/third-parties, @vercel/devlow-bench, @vercel/turbopack-cli, @vercel/turbopack-ecmascript-runtime, @vercel/turbopack-next, @vercel/turbopack-node, bench-app-router-server, bench-heavy-npm-deps, bench-nested-deps, bench-nested-deps-app-router, bench-production, bench-recursive-delete, bench-rendering, create-next-app, eslint-config-next, execution-test, fuzzponent, module-cost, nested-deps-app-router-many-pages, next, next-minimal-server, next-rspack       
   • Running dev in 36 packages
   • Remote caching disabled

┌─ @next/polyfill-module#dev > cache miss, executing 911a0cbdb4bfec3e       
cache miss, executing 911a0cbdb4bfec3e


> @next/polyfill-module@16.3.1-canary.22 dev /home/abdia
n/contribution-to-oss/next.js/packages/next-polyfill-mod
ule
> pnpm build


> @next/polyfill-module@16.3.1-canary.22 build /home/abd
ian/contribution-to-oss/next.js/packages/next-polyfill-m
odule
> microbundle -i src/index.js -o dist/polyfill-module.js
 -f iife --no-sourcemap --external none --no-pkg-main

Build "@next/polyfill-module" to dist:
        596 B: polyfill-module.js.gz
        513 B: polyfill-module.js.br
└─ @next/polyfill-module#dev ──
┌─ @next/playwright#dev > cache miss, executing c6d72499d9c976fc
cache miss, executing c6d72499d9c976fc
└─ @next/playwright#dev ──
┌─ create-next-app#dev > cache miss, executing 9f5dad9a6970a965
cache miss, executing 9f5dad9a6970a965
└─ create-next-app#dev ──
┌─ @next/eslint-plugin-next#dev > cache miss, executing a0579ee175a63972    
cache miss, executing a0579ee175a63972


> @next/eslint-plugin-next@16.3.1-canary.22 dev /home/ab
dian/contribution-to-oss/next.js/packages/eslint-plugin-
next
> pnpm build


> @next/eslint-plugin-next@16.3.1-canary.22 build /home/
abdian/contribution-to-oss/next.js/packages/eslint-plugi
n-next
> swc -d dist src && pnpm types

Successfully compiled: 27 files with swc (57.03ms)

> @next/eslint-plugin-next@16.3.1-canary.22 types /home/
abdian/contribution-to-oss/next.js/packages/eslint-plugi
n-next
> tsc --project tsconfig.json --skipLibCheck --declarati
on --emitDeclarationOnly --esModuleInterop --declaration
Dir dist
└─ @next/eslint-plugin-next#dev ──
┌─ @next/font#dev > cache miss, executing 845962619748647c
cache miss, executing 845962619748647c


> @next/font@16.3.1-canary.22 dev /home/abdian/contribut
ion-to-oss/next.js/packages/font
> pnpm ncc-fontkit && tsc -d -w -p tsconfig.json

 ELIFECYCLE  Command failed.
└─ @next/font#dev ──
┌─ @next/codemod#dev > cache miss, executing b5396c0b3b068c67
cache miss, executing b5396c0b3b068c67


> @next/codemod@16.3.1-canary.22 dev /home/abdian/contri
bution-to-oss/next.js/packages/next-codemod
> pnpm tsc -d -w -p tsconfig.json

[7:12:05 AM] Starting compilation in watch mode...

 ELIFECYCLE  Command failed.
└─ @next/codemod#dev ──
┌─ next#dev > cache miss, executing efacf0c3675e2a0f
cache miss, executing efacf0c3675e2a0f


> next@16.3.1-canary.22 dev /home/abdian/contribution-to
-oss/next.js/packages/next
> cross-env NEXT_SERVER_NO_MANGLE=1 taskr

[07:12:04] Running with /home/abdian/contribution-to-oss
/next.js/packages/next/taskfile.js
[07:12:04] Starting default
[07:12:04] Starting build
[07:12:04] Starting precompile
[07:12:04] Starting browser_polyfills
[07:12:04] Starting next__polyfill_nomodule
[07:12:04] Starting next__polyfill_module
[07:12:05] Starting copy_ncced
[07:12:05] Starting copy_styled_jsx_assets
[07:12:05] Starting copy_docs
[07:12:05] next__polyfill_nomodule failed because Cannot
 find module '/home/abdian/contribution-to-oss/next.js/p
ackages/next/node_modules/@next/polyfill-nomodule/dist/p
olyfill-nomodule.js'. Please verify that the package.jso
n has a valid "main" entry
[07:12:05] next__polyfill_module failed because Cannot f
ind module '/home/abdian/contribution-to-oss/next.js/pac
kages/next/node_modules/@next/polyfill-module/dist/polyf
ill-module.js'. Please verify that the package.json has 
a valid "main" entry
[07:12:05] browser_polyfills failed because Cannot find 
module '/home/abdian/contribution-to-oss/next.js/package
s/next/node_modules/@next/polyfill-nomodule/dist/polyfil
l-nomodule.js'. Please verify that the package.json has 
a valid "main" entry
[07:12:05] precompile failed because Cannot find module 
'/home/abdian/contribution-to-oss/next.js/packages/next/
node_modules/@next/polyfill-nomodule/dist/polyfill-nomod
ule.js'. Please verify that the package.json has a valid
 "main" entry
[07:12:05] Task chain was aborted!
[07:12:05] Finished build in 29ms
[07:12:05] Finished default in 67ms
[07:12:06] Finished copy_docs in 1.26s
[07:12:06] Finished copy_ncced in 1.47s
[07:12:06] Finished copy_styled_jsx_assets in 1.47s
 ELIFECYCLE  Command failed.
└─ next#dev ──
┌─ @next/third-parties#dev > cache miss, executing 4bbabd0ddcc17674
[7:12:04 AM] Starting compilation in watch mode...

../next/script.d.ts:1:20 - error TS2307: Cannot find mod
ule './dist/client/script' or its corresponding type dec
larations.

1 import Script from './dist/client/script'
                     ~~~~~~~~~~~~~~~~~~~~~~

../next/script.d.ts:2:15 - error TS2307: Cannot find mod
ule './dist/client/script' or its corresponding type dec
larations.

2 export * from './dist/client/script'
                ~~~~~~~~~~~~~~~~~~~~~~

src/google/youtube-embed.tsx:2:15 - error TS2614: Module
 '"next/script"' has no exported member 'ScriptProps'. D
id you mean to use 'import ScriptProps from "next/script
"' instead?

2 import type { ScriptProps } from 'next/script'
                ~~~~~~~~~~~

[7:12:11 AM] Found 3 errors. Watching for file changes.

 ELIFECYCLE  Command failed.
└─ @next/third-parties#dev ──
┌─ @next/routing#dev > cache miss, executing fbae181a152aab80
cache miss, executing fbae181a152aab80


> @next/routing@16.3.1-canary.22 dev /home/abdian/contri
bution-to-oss/next.js/packages/next-routing
> ncc build ./src/index.ts -w -o dist/

ncc: Version 0.38.4
ncc: Compiling file index.js into CJS
File change, rebuilding...
ncc: Using typescript@6.0.2 (local user-provided)
 ELIFECYCLE  Command failed.
└─ @next/routing#dev ──
┌─ @next/env#dev > cache miss, executing a3dc988c1785b653
cache miss, executing a3dc988c1785b653


> @next/env@16.3.1-canary.22 dev /home/abdian/contributi
on-to-oss/next.js/packages/next-env
> ncc build ./index.ts -w -o dist/

ncc: Version 0.38.4
ncc: Compiling file index.js into CJS
File change, rebuilding...
ncc: Using typescript@6.0.2 (local user-provided)
 ELIFECYCLE  Command failed.
└─ @next/env#dev ──
┌─ @next/react-refresh-utils#dev > cache miss, executing 8e17b242b6ca5031   
cache miss, executing 8e17b242b6ca5031


> @next/react-refresh-utils@16.3.1-canary.22 dev /home/a
bdian/contribution-to-oss/next.js/packages/react-refresh
-utils
> tsc -d -w -p tsconfig.json

[7:12:04 AM] Starting compilation in watch mode...

[7:12:07 AM] Found 0 errors. Watching for file changes.

 ELIFECYCLE  Command failed.
└─ @next/react-refresh-utils#dev ──
┌─ @next/polyfill-nomodule#dev > cache miss, executing 57bb94dbf1c18339     
cache miss, executing 57bb94dbf1c18339


> @next/polyfill-nomodule@16.3.1-canary.22 dev /home/abd
ian/contribution-to-oss/next.js/packages/next-polyfill-n
omodule
> pnpm build


> @next/polyfill-nomodule@16.3.1-canary.22 build /home/a
bdian/contribution-to-oss/next.js/packages/next-polyfill
-nomodule
> microbundle -i src/index.js -o dist/polyfill-nomodule.
js -f iife --no-sourcemap --external none --no-pkg-main

 ELIFECYCLE  Command failed.
 ELIFECYCLE  Command failed.
└─ @next/polyfill-nomodule#dev ──
┌─ eslint-config-next#dev > cache miss, executing 7f9757e7d2ed1b28
cache miss, executing 7f9757e7d2ed1b28


> eslint-config-next@16.3.1-canary.22 dev /home/abdian/c
ontribution-to-oss/next.js/packages/eslint-config-next
> pnpm build


> eslint-config-next@16.3.1-canary.22 build /home/abdian
/contribution-to-oss/next.js/packages/eslint-config-next
> swc -d dist src && pnpm types

Successfully compiled: 4 files with swc (33.1ms)

> eslint-config-next@16.3.1-canary.22 types /home/abdian
/contribution-to-oss/next.js/packages/eslint-config-next
> tsc --skipLibCheck --declaration --emitDeclarationOnly
 --esModuleInterop --declarationDir dist --rootDir src

src/core-web-vitals.ts:2:24 - error TS7016: Could not fi
nd a declaration file for module '@next/eslint-plugin-ne
xt'. '/home/abdian/contribution-to-oss/next.js/packages/
eslint-plugin-next/dist/index.js' implicitly has an 'any
' type.
  Try `npm i --save-dev @types/next__eslint-plugin-next`
 if it exists or add a new declaration (.d.ts) file cont
aining `declare module '@next/eslint-plugin-next';`

2 import nextPlugin from '@next/eslint-plugin-next'
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/index.ts:4:18 - error TS7016: Could not find a decla
ration file for module '@next/eslint-plugin-next'. '/hom
e/abdian/contribution-to-oss/next.js/packages/eslint-plu
gin-next/dist/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/next__eslint-plugin-next`
 if it exists or add a new declaration (.d.ts) file cont
aining `declare module '@next/eslint-plugin-next';`

4 import next from '@next/eslint-plugin-next'
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  src/core-web-vitals.ts:2
     1  src/index.ts:4
 ELIFECYCLE  Command failed with exit code 2.
 ELIFECYCLE  Command failed with exit code 2.
 ELIFECYCLE  Command failed with exit code 2.
└─ eslint-config-next#dev ──

 Tasks:    1 successful, 13 total
Cached:    0 cached, 13 total
  Time:    11.32s
Failed:    eslint-config-next#dev

 ELIFECYCLE  Command failed with exit code 2.                               
abdian@abdian:~/contribution-to-oss/next.js$

And after I ran pnpm build and then pnpm dev, the process ran normally.

Does the docs page already exist? Please link to it.

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL