D-Pagey

D-Pagey

Lead FullStack Developer

Member Since 5 years ago

@Titan-Academy , London

Experience Points
30
follower
Lessons Completed
11
follow
Lessons Completed
32
stars
Best Reply Awards
26
repos

1480 contributions in the last year

Pinned
⚡ Old personal website
⚡ A custom web widget to replicate the functionality of Revolut's exchange screen
Activity
Apr
21
1 month ago
Activity icon
issue

D-Pagey issue comment vercel/next.js

D-Pagey
D-Pagey

Updating from 12.1.4 to 12.1.5: Error: Cannot find module 'next/dist/shared/lib/router/utils/routing-items.js'

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64
Binaries:
  Node: 16.14.0
  npm: 8.3.1
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 12.1.6-canary.3
  react: 17.0.2
  react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

After updating from 12.1.4 => 12.1.5 (and 12.1.6-canary.3) I get this build error. Downgrading back to 12.1.4 resolves the issue.

next -p 8080

node:internal/modules/cjs/loader:933 const err = new Error(message); ^

Error: Cannot find module 'next/dist/shared/lib/router/utils/routing-items.js' Require stack:

  • /Users/me/hello/client/.next/server/pages/_app.js
  • /Users/me/hello/client/node_modules/next/dist/server/require.js
  • /Users/me/hello/client/node_modules/next/dist/server/load-components.js
  • /Users/me/hello/client/node_modules/next/dist/build/utils.js
  • /Users/me/hello/client/node_modules/next/dist/build/output/store.js
  • /Users/me/hello/client/node_modules/next/dist/build/output/index.js
  • /Users/me/hello/client/node_modules/next/dist/cli/next-dev.js
  • /Users/me/hello/client/node_modules/next/dist/bin/next at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.mod._resolveFilename (/Users/me/hello/client/node_modules/next/dist/build/webpack/require-hook.js:183:28) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object../utils/routing-items (/Users/me/hello/client/.next/server/pages/_app.js:1229:18) at webpack_require (/Users/me/hello/client/.next/server/webpack-runtime.js:33:42) at eval (webpack-internal:///./node_modules/next/dist/shared/lib/router/router.js:45:21) at Object../node_modules/next/dist/shared/lib/router/router.js (/Users/me/hello/client/.next/server/pages/_app.js:99:1) at webpack_require (/Users/me/hello/client/.next/server/webpack-runtime.js:33:42) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/me/hello/client/.next/server/pages/_app.js', '/Users/me/hello/client/node_modules/next/dist/server/require.js', '/Users/me/hello/client/node_modules/next/dist/server/load-components.js', '/Users/me/hello/client/node_modules/next/dist/build/utils.js', '/Users/me/hello/client/node_modules/next/dist/build/output/store.js', '/Users/me/hello/client/node_modules/next/dist/build/output/index.js', '/Users/me/hello/client/node_modules/next/dist/cli/next-dev.js', '/Users/me/hello/client/node_modules/next/dist/bin/next' ] }

Expected Behavior

Build correctly

To Reproduce

See stack trace, 'next/dist/shared/lib/router/utils/routing-items.js' is missing from node_modules.

D-Pagey
D-Pagey

OK - I was able to fix this issue by deleting ~/.next. Seems like a build cache bug. Latest version removed routing-items.js but cached build files still require it?

Had the same issue and this fixed for me as well 👍

Apr
9
1 month ago
Activity icon
issue

D-Pagey issue comment react-navigation/react-navigation

D-Pagey
D-Pagey

CompositeScreenProps - route correctly typed, navigation set to any

Current behavior

Trying to type a Tab Navigator as a parent of a Stack Navigator. Followed the docs on Typescript - https://reactnavigation.org/docs/typescript/

When I use my type helper that utilises CompositeScreenProps, my route prop is typed but my navigation prop is:

Screenshot 2022-04-08 at 23 18 25

Here are the only types I use:

Screenshot 2022-04-08 at 22 59 02 Screenshot 2022-04-08 at 23 04 44

Expected behavior

I'd expect my navigation.navigate to be typed when using CompositeScreenProps.

Reproduction

Repo - https://github.com/D-Pagey/react-navigation-repro/blob/main/types/navigation.ts

File that is typed incorrectly - https://github.com/D-Pagey/react-navigation-repro/blob/main/types/navigation.ts

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 6.0.8
@react-navigation/bottom-tabs 6.3.1
@react-navigation/stack 6.2.1
@react-navigation/native-stack 6.5.0
react-native-safe-area-context 3.3.2
react-native-screens 3.10.1
react-native 0.64.3
expo 44.0.0
node 14.18.2
npm or yarn 1.22.17
Activity icon
created branch
createdAt 1 month ago
Apr
8
1 month ago
Activity icon
issue

D-Pagey issue react-navigation/react-navigation

D-Pagey
D-Pagey

CompositeScreenProps - route correctly typed, navigation set to any

Current behavior

Trying to type a Tab Navigator as a parent of a Stack Navigator. Followed the docs on Typescript - https://reactnavigation.org/docs/typescript/

When I use my type helper that utilises CompositeScreenProps, my route prop is typed but my navigation prop is:

Screenshot 2022-04-08 at 23 18 25

Here are the only types I use:

Screenshot 2022-04-08 at 22 59 02

Expected behavior

I'd expect my navigation.navigate to be typed when using CompositeScreenProps.

Reproduction

https://snack.expo.dev/@dpagey/navigation-type-repro

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 6.0.8
@react-navigation/bottom-tabs 6.3.1
@react-navigation/stack 6.2.1
@react-navigation/native-stack 6.5.0
react-native-safe-area-context 3.3.2
react-native-screens 3.10.1
react-native 0.64.3
expo 44.0.0
node 14.18.2
npm or yarn 1.22.17