Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when build #188

Open
snowinszu opened this issue Dec 19, 2023 · 1 comment
Open

error when build #188

snowinszu opened this issue Dec 19, 2023 · 1 comment

Comments

@snowinszu
Copy link

When run "npm run build", there is an error:
Nested Middleware is not allowed, found:
pages/_middleware
pages/v/[id]/_middleware

@dylanjha
Copy link
Collaborator

Running yarn build works for me on latest main ref

Build logs
~/code/@muxinc/stream.new main
❯ g status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
Execution time: 0.03s

~/code/@muxinc/stream.new main
❯ yarn
yarn install v1.22.19
warning ../../package.json: No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > swr@0.2.3" has incorrect peer dependency "react@^16.11.0".
warning " > babel-jest@27.5.1" has unmet peer dependency "@babel/core@^7.8.0".
warning "babel-jest > babel-preset-jest@27.5.1" has unmet peer dependency "@babel/core@^7.0.0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax@1.0.1" has unmet peer dependency "@babel/core@^7.0.0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-async-generators@7.8.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-bigint@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-class-properties@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-import-meta@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-json-strings@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-logical-assignment-operators@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-nullish-coalescing-operator@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-numeric-separator@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-object-rest-spread@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-optional-catch-binding@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-optional-chaining@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-top-level-await@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > enzyme-adapter-react-16@1.15.6" has incorrect peer dependency "react@^16.0.0-0".
warning " > enzyme-adapter-react-16@1.15.6" has incorrect peer dependency "react-dom@^16.0.0-0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils@1.14.0" has incorrect peer dependency "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0".
warning "enzyme-adapter-react-16 > react-test-renderer@16.14.0" has incorrect peer dependency "react@^16.14.0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils > airbnb-prop-types@2.16.0" has incorrect peer dependency "react@^0.14 || ^15.0.0 || ^16.0.0-alpha".
[4/4] 🔨  Building fresh packages...
✨  Done in 3.92s.
Execution time: 4.48s

~/code/@muxinc/stream.new main
❯ yarn build
yarn run v1.22.19
warning ../../package.json: No license field
$ yarn lint && next build
warning ../../package.json: No license field
$ yarn eslint . --ext .js,.jsx,.ts,.tsx
warning ../../package.json: No license field
$ /Users/djhaveri/code/@muxinc/stream.new/node_modules/.bin/eslint . --ext .js,.jsx,.ts,.tsx
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.5.0

YOUR TYPESCRIPT VERSION: 4.5.5

Please only submit bug reports when using the officially supported version.

=============
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .

/Users/djhaveri/code/@muxinc/stream.new/lib/urlutils.ts
  3:8  warning  Missing return type on function  @typescript-eslint/explicit-module-boundary-types
  7:8  warning  Missing return type on function  @typescript-eslint/explicit-module-boundary-types

✖ 2 problems (0 errors, 2 warnings)

info  - Loaded env from /Users/djhaveri/code/@muxinc/stream.new/.env.local
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
info  - Checking validity of types
warn  - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .

./lib/urlutils.ts
3:8  Warning: Missing return type on function.  @typescript-eslint/explicit-module-boundary-types
7:8  Warning: Missing return type on function.  @typescript-eslint/explicit-module-boundary-types

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
warn  - using beta Middleware (not covered by semver) - https://nextjs.org/docs/messages/beta-middleware
info  - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
info  - Using external babel configuration from /Users/djhaveri/code/@muxinc/stream.new/.babelrc
info  - Creating an optimized production build
info  - Compiled successfully
info  - Collecting page data
info  - Generating static pages (10/10)
info  - Finalizing page optimization

Page                                       Size     First Load JS
┌ ○ /                                      3.92 kB         101 kB
├ ƒ /_middleware                           910 B           118 kB
├ ○ /404                                   2.84 kB        73.1 kB
├ λ /api/assets/[id]                       0 B            70.2 kB
├ λ /api/oembed                            0 B            70.2 kB
├ λ /api/report                            0 B            70.2 kB
├ λ /api/telemetry                         0 B            70.2 kB
├ λ /api/uploads                           0 B            70.2 kB
├ λ /api/uploads/[id]                      0 B            70.2 kB
├ λ /api/webhooks/mux                      0 B            70.2 kB
├ ○ /assets/[id]                           1.96 kB        99.3 kB
├ ○ /moderator/delete-asset                2.41 kB        95.5 kB
├ ○ /record                                16.2 kB         113 kB
├ ○ /terms                                 905 B            94 kB
├ ● /v/[id]                                396 B           101 kB
├ ƒ /v/[id]/_middleware                    855 B           118 kB
├ ● /v/[id]/[playerType]                   394 B           101 kB
└ ● /v/[id]/embed                          4.75 kB        97.9 kB
+ First Load JS shared by all              70.2 kB
  ├ chunks/framework-8957c350a55da097.js   42.2 kB
  ├ chunks/main-96060e10e65c9c86.js        24.9 kB
  ├ chunks/pages/_app-d821886ca7955871.js  979 B
  └ chunks/webpack-557595145310b521.js     2.13 kB

ƒ  (Middleware)  intercepts requests (uses _middleware)
λ  (Server)      server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)      automatically rendered as static HTML (uses no initial props)
●  (SSG)         automatically generated as static HTML + JSON (uses getStaticProps)

✨  Done in 18.25s.
Execution time: 18.58s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants