startup-nextjs icon indicating copy to clipboard operation
startup-nextjs copied to clipboard

When the project is executed with the "next build && next export" command, the "Cannot find module for page: /error" error is reported

Open taoxiaofeng opened this issue 2 years ago • 0 comments

{ "name": "startup-nextjs-template", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build && next export", "start": "next start", "lint": "next lint" }, "dependencies": { "@next/font": "13.1.6", "eslint": "8.33.0", "eslint-config-next": "13.1.6", "next": "13.1.6", "next-themes": "^0.2.1", "react": "18.2.0", "react-dom": "18.2.0", "react-modal-video": "^2.0.0" }, "devDependencies": { "@types/node": "^18.15.11", "@types/react": "^18.0.34", "autoprefixer": "^10.4.13", "postcss": "^8.4.21", "prettier": "^2.8.3", "prettier-plugin-tailwindcss": "^0.2.2", "tailwindcss": "^3.2.4", "typescript": "^5.0.4" } }

$ next build && next export warn - You have enabled experimental feature (appDir) in next.config.js. warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk. info - Thank you for testing appDir please leave your feedback at https://nextjs.link/app-feedback

info - Creating an optimized production build
info - Compiled successfully info - Linting and checking validity of types ..Pages directory cannot be found at /Users/taoxiaofeng/startup-nextjs/pages or /Users/taoxiaofeng/startup-nextjs/src/pages. If using a custom path, please configure with the no-html-link-for-pages rule in your eslint config file.

./components/Video/index.tsx 61:9 Warning: Using <img> could result in slower LCP and higher bandwidth. Use <Image /> from next/image instead to utilize Image Optimization. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element

info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules info - Linting and checking validity of types
info - Collecting page data
info - Generating static pages (11/11) info - Finalizing page optimization

Route (app) Size First Load JS ┌ ○ / 0 B 0 B ├ ○ /about 187 B 89.7 kB ├ ○ /blog 186 B 89.7 kB ├ ○ /blog-details 170 B 87.6 kB ├ ○ /blog-sidebar 187 B 89.7 kB ├ ○ /contact 181 B 85 kB ├ ○ /error 181 B 85 kB ├ ○ /signin 181 B 85 kB └ ○ /signup 181 B 85 kB

  • First Load JS shared by all 82.8 kB ├ chunks/17-4e8fdc7dead168ed.js 80.4 kB ├ chunks/main-app-ee6095fcf570d5e7.js 216 B └ chunks/webpack-7793c2692b6bb74a.js 2.13 kB

Route (pages) Size First Load JS ─ ○ /404 179 B 81.2 kB

  • First Load JS shared by all 81.1 kB ├ chunks/main-e9ff11a58bf7a0ec.js 78.7 kB ├ chunks/pages/_app-5841ab2cb3aa228d.js 192 B └ chunks/webpack-7793c2692b6bb74a.js 2.13 kB

○ (Static) automatically rendered as static HTML (uses no initial props)

warn - You have enabled experimental feature (appDir) in next.config.js. warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk. info - Thank you for testing appDir please leave your feedback at https://nextjs.link/app-feedback

info - using build directory: /Users/taoxiaofeng/startup-nextjs/.next info - Copying "static build" directory info - No "exportPathMap" found in "/Users/taoxiaofeng/startup-nextjs/next.config.js". Generating map from "./pages" info - Launching 7 workers info - Copying "public" directory info - Exporting (2/2) PageNotFoundError: Cannot find module for page: /error at Object.getPagePath (/Users/taoxiaofeng/startup-nextjs/node_modules/next/dist/server/require.js:77:15) at /Users/taoxiaofeng/startup-nextjs/node_modules/next/dist/export/index.js:382:48 at Array.map () at /Users/taoxiaofeng/startup-nextjs/node_modules/next/dist/export/index.js:373:69 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Span.traceAsyncFn (/Users/taoxiaofeng/startup-nextjs/node_modules/next/dist/trace/trace.js:79:20) { code: 'ENOENT' } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

taoxiaofeng avatar Oct 24 '23 12:10 taoxiaofeng