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

Bug: Vercel deployment results in TypeError: Cannot read properties of null (reading 'useMemo') #1399

Closed
pavan38kp opened this issue May 4, 2023 · 23 comments · Fixed by #1404
Labels
🐞 upstream bug Blocked by a bug upstream

Comments

@pavan38kp
Copy link

Provide environment information

System:
OS: macOS 11.6.1
CPU: (8) arm64 Apple M1
Memory: 112.23 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 18.13.0 - /usr/local/bin/node
Yarn: 1.22.17 - ~/.yarn/bin/yarn
npm: 8.19.3 - /usr/local/bin/npm

Describe the bug

This issue occurs when an attempt is made to deploy the application on Vercel.

image
image

Reproduction repo

https://github.com/pavankpdev/sica

To reproduce

  1. Fork/Clone the repo - This is actually a fresh installation if T3
  2. deploy with vercel

Additional information

  1. I created a new T3 app project to check if my project was causing the issue.
  2. However, I discovered that even the new T3 app fails to deploy with similar issues.
@pavan38kp pavan38kp changed the title Vercel deployment results in TypeError: Cannot read properties of null (reading 'useMemo') Bug: Vercel deployment results in TypeError: Cannot read properties of null (reading 'useMemo') May 4, 2023
@tonyno
Copy link

tonyno commented May 4, 2023

Having same issue :-(

The local build works fine.

tonda@tonda-macbook my-t3-app % npm run build      

> my-t3-app@0.1.0 build
> next build

info  - Loaded env from /Users/tonda/Documents/GIT/my-t3-app/.env
info  - Linting and checking validity of types  
info  - Creating an optimized production build  
info  - Compiled successfully
info  - Collecting page data  
info  - Generating static pages (6/6)
info  - Finalizing page optimization  

Route (pages)                              Size     First Load JS
┌ ○ /                                      3.57 kB         113 kB
├   └ css/f80f0d6a5fc5d41a.css             719 B
├   /_app                                  0 B             109 kB
├ ○ /404                                   182 B           109 kB
├ λ /api/auth/[...nextauth]                0 B             109 kB
└ λ /api/trpc/[trpc]                       0 B             109 kB
+ First Load JS shared by all              109 kB
  ├ chunks/framework-2c79e2a64abdb08b.js   45.2 kB
  ├ chunks/main-6b44c25d2e9e2e39.js        27.5 kB
  ├ chunks/pages/_app-726936a19a8ef54d.js  35.4 kB
  ├ chunks/webpack-ee7e63bc15b31913.js     815 B
  └ css/27d177a30947857b.css               194 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)

@c-ehrlich
Copy link
Member

I can reproduce the issue with your repo, but it does not happen on one I created myself with the same version/packages:

https://github.com/c-ehrlich/test2

https://test2-vert-one.vercel.app/

Can you confirm that you're able to deploy my repo?

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 84
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://test2-vert-one.vercel.app/

@pavan38kp
Copy link
Author

I can reproduce the issue with your repo, but it does not happen on one I created myself with the same version/packages:

https://github.com/c-ehrlich/test2

https://test2-vert-one.vercel.app/

Can you confirm that you're able to deploy my repo?

Strange I was able to deploy it with your repo. Can you try to reproduce with my repo using main branch

@michalbundyra
Copy link
Contributor

@pavan38kp @c-ehrlich maybe it works because it is fixed with + next 13.2.4. The problem is since next 13.4.0, I have the same on my project when renovate created PRs to update to 13.4.0

@pavan38kp
Copy link
Author

@pavan38kp @c-ehrlich maybe it works because it is fixed with + next 13.2.4. The problem is since next 13.4.0, I have the same on my project when renovate created PRs to update to 13.4.0

So upgrading to 13.4 would help?

@michalbundyra
Copy link
Contributor

@pavan38kp

So upgrading to 13.4 would help?

If by "help" you mean reproduce the reported issue - then yes ;-)

@pavan38kp
Copy link
Author

@pavan38kp

So upgrading to 13.4 would help?

If by "help" you mean reproduce the reported issue - then yes ;-)

Alrught, I'm trying this now.

@pavan38kp
Copy link
Author

Well, I tried to reproduce with next 13.4, and it still fails with the same issues. :(
@michalbundyra

@calleminviktor
Copy link

I can reproduce the issue with your repo, but it does not happen on one I created myself with the same version/packages:

https://github.com/c-ehrlich/test2

https://test2-vert-one.vercel.app/

Can you confirm that you're able to deploy my repo?

Same issues, same solution

@tonyno
Copy link

tonyno commented May 4, 2023

I tried to upgrade to latest version of all libraries, but it didn't help either.
Repo: https://github.com/tonyno/my-t3-app

Upgrade:

npm i -g npm-check-updates
ncu -u
npm install

I am using base version from T3 generator using all libraries except Tailwindcss (compared to https://github.com/pavankpdev/sica I am using next-auth). But same error for me.

I am using npm and MacOS. Node version v18.16.0

@michalbundyra
Copy link
Contributor

See also trpc/trpc#4316

@pavan38kp
Copy link
Author

Just a heads up, I just tried to deploy the app on Netlify and it worked.
@tonyno @calleminviktor do try Netlify once.

@esthevann
Copy link

Same issue here with a fresh template https://github.com/esthevann/chirp

@bookofdom
Copy link

Same problen

@baseba
Copy link

baseba commented May 5, 2023

As said by @c-ehrlich just change in your dependencies in package.json
"next": "^13.2.4" to "next": "13.2.4"
This should do the work while there is a definitive fix

@thefirebanks
Copy link

As said by @c-ehrlich just change in your dependencies in package.json
"next": "^13.2.4" to "next": "13.2.4"
This should do the work while there is a definitive fix

Can confirm that this worked for me!

@tonyno
Copy link

tonyno commented May 5, 2023

@baseba thank you a lot. You guys are awesome. Now it works. Thanx.

@pavan38kp
Copy link
Author

yes Thanks @baseba it works now

@c-ehrlich
Copy link
Member

Can confirm that it's caused by this trpc/trpc#4316

Let's pin Next to 13.2.4 until that is fixed. I'm writing the pr now and will subscribe to the issue so that we can undo the pinning asap.

Thanks @pavan38kp @michalbundyra for finding and profiling this.

Will leave this open for the time being so that people who have scaffolded with the bug can see it :)

@michalbundyra
Copy link
Contributor

@c-ehrlich 13.3.4 is also fine, the problem is only with 13.4.0, any previous version works fine.

@michalbundyra
Copy link
Contributor

Seems to be fixed now with NextJS 13.4.1 - probably in vercel/next.js#49274

@belgattitude
Copy link

belgattitude commented May 5, 2023

I can confirm 13.4.1 works - tested in belgattitude/nextjs-monorepo-example#3775

michalbundyra added a commit to michalbundyra/create-t3-app that referenced this issue May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 upstream bug Blocked by a bug upstream
Projects
None yet