question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught error Cannot read property 'blue' of undefined

See original GitHub issue

Everything worked fine for couple months and suddenly it is no longer working

Describe the bug

Uncaught error Cannot read property ‘blue’ of undefined

Stack:

TypeError: at https://369leh.vercel.app/static/js/app.bundle.js?de392c25b71c5062dc63:78:25696 at Array.reduce (<anonymous>) at Object.<anonymous> (https://369leh.vercel.app/static/js/app.bundle.js?de392c25b71c5062dc63:78:25658) at l (https://369leh.vercel.app/static/js/vendor.bundle.js?4f7e199f796bdcb9a3f5:1:410) at Object.<anonymous> (https://369leh.vercel.app/static/js/app.bundle.js?de392c25b71c5062dc63:78:24173) at l (https://369leh.vercel.app/static/js/vendor.bundle.js?4f7e199f796bdcb9a3f5:1:410) at Object.<anonymous> (https://369leh.vercel.app/static/js/app.bundle.js?de392c25b71c5062dc63:78:23935) at l (https://369leh.vercel.app/static/js/vendor.bundle.js?4f7e199f796bdcb9a3f5:1:410) at Object.<anonymous> (https://369leh.vercel.app/static/js/app.bundle.js?de392c25b71c5062dc63:78:23739) at l (https://369leh.vercel.app/static/js/vendor.bundle.js?4f7e199f796bdcb9a3f5:1:410)

(Your browsers Developer Tools may contain more info) Uncaught TypeError: Cannot read property ‘blue’ of undefined at app.bundle.js?de392c25b71c5062dc63:78 at Array.reduce (<anonymous>) at Object.<anonymous> (app.bundle.js?de392c25b71c5062dc63:78) at l (vendor.bundle.js?4f7e199f796bdcb9a3f5:1) at Object.<anonymous> (app.bundle.js?de392c25b71c5062dc63:78) at l (vendor.bundle.js?4f7e199f796bdcb9a3f5:1) at Object.<anonymous> (app.bundle.js?de392c25b71c5062dc63:78) at l (vendor.bundle.js?4f7e199f796bdcb9a3f5:1) at Object.<anonymous> (app.bundle.js?de392c25b71c5062dc63:78) at l (vendor.bundle.js?4f7e199f796bdcb9a3f5:1)

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://369leh.vercel.app/

Expected behavior

I was expecting to be asked for login.

Run sanity versions in the terminal and copy-paste the result here. @sanity/cli 2.10.0 (up to date) @sanity/base 2.10.2 (up to date) @sanity/cli 2.10.0 (up to date) @sanity/code-input 2.9.0 (up to date) @sanity/components 2.2.6 (up to date) @sanity/core 2.10.2 (up to date) @sanity/default-layout 2.10.2 (up to date) @sanity/default-login 2.8.0 (up to date) @sanity/desk-tool 2.10.4 (up to date) @sanity/production-preview 2.2.6 (up to date) @sanity/vision 2.10.0 (up to date) What operating system are you using?

Which versions of Node.js / npm are you running?

Run npm -v && node -v in the terminal and copy-paste the result here. 6.14.13 v14.17.0

Additional context

Add any other context about the problem here. It may be related, or not, not sure, I can access the studio in development using localhost:3333, but the preview feature is not working. When clicking on “Open Preview” I am getting the error: Internal Server Error And here are the details in the console:

Loaded env from /Users/levi/react_projects/test/369leh/frontend/.env.local ready - started server on 0.0.0.0:3000, url: http://localhost:3000 event - compiled successfully event - build page: / wait - compiling… event - compiled successfully Using the Sanity client without specifying an API version is deprecated. See https://docs.sanity.io/help/js-client-api-version event - build page: /api/blogs wait - compiling… event - compiled successfully event - build page: /api/preview wait - compiling… event - compiled successfully ClientError: Unauthorized - Session not found at onResponse (/Users/levi/react_projects/test/369leh/frontend/node_modules/@sanity/client/lib/http/request.js:27:13) at applyMiddleware (/Users/levi/react_projects/test/369leh/frontend/node_modules/get-it/lib-node/util/middlewareReducer.js:14:23) at onResponse (/Users/levi/react_projects/test/369leh/frontend/node_modules/get-it/lib-node/index.js:81:22) at /Users/levi/react_projects/test/369leh/frontend/node_modules/get-it/lib-node/index.js:48:55 at callback (/Users/levi/react_projects/test/369leh/frontend/node_modules/get-it/lib-node/request/node-request.js:57:46) at /Users/levi/react_projects/test/369leh/frontend/node_modules/get-it/lib-node/request/node-request.js:141:14 at DestroyableTransform.<anonymous> (/Users/levi/react_projects/test/369leh/frontend/node_modules/simple-concat/index.js:8:13) at Object.onceWrapper (events.js:482:28) at DestroyableTransform.emit (events.js:388:22) at endReadableNT (/Users/levi/react_projects/test/369leh/frontend/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:1010:12) at processTicksAndRejections (internal/process/task_queues.js:82:21) { response: { body: { errorCode: ‘SIO-401-ANF’, message: ‘Session not found’, statusCode: 401, error: ‘Unauthorized’ }, url: “https://ulym7tod.api.sanity.io/v1/data/query/production?query=*[_type %3D%3D “blog” %26%26 slug.current %3D%3D %24slug] { title%2C subtitle%2C ‘slug’%3A slug.current%2C date%2C ‘author’%3A author->{name%2C ‘avatar’%3A avatar.asset->url}%2C coverImage%2C content[]{...%2C “asset”%3A asset->} }&%24slug=“first-tought””, method: ‘GET’, headers: { date: ‘Fri, 21 May 2021 16:36:38 GMT’, ‘content-type’: ‘application/json; charset=utf-8’, ‘x-ratelimit-limit-second’: ‘500’, ‘x-ratelimit-remaining-second’: ‘499’, ‘ratelimit-remaining’: ‘499’, ‘ratelimit-limit’: ‘500’, ‘ratelimit-reset’: ‘1’, ‘content-length’: ‘97’, vary: ‘Origin’, xkey: ‘project-ulym7tod, project-ulym7tod-production’, via: ‘1.1 google’, ‘alt-svc’: ‘clear’, connection: ‘close’ }, statusCode: 401, statusMessage: ‘Unauthorized’ }, statusCode: 401, responseBody: ‘{\n’ + ’ “errorCode”: “SIO-401-ANF”,\n’ + ’ “message”: “Session not found”,\n’ + ’ “statusCode”: 401,\n’ + ’ “error”: “Unauthorized”\n’ + ‘}’ }

Not sure what is going on here but something is not right. Any help will be much appreciated.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
levi-l-damiancommented, May 25, 2021

This one fixed the problem, many thanks. $ rm -rf node_modules yarn.lock && npm i

Many thnaks!

1reaction
rexxarscommented, May 25, 2021

Could you try reinstalling dependencies by doing rm -rf node_modules yarn.lock && yarn (or rm -rf node_modules yarn.lock && npm i if you prefer npm)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'blue' of undefined #1 - GitHub
This is the error thrown after git'ing your repository and running basic.js out of the box. I believe the use of the colors...
Read more >
How to resolve problem with chain select Uncaught TypeError
1 Answer 1 · You try to run the functions on load, when nothing is selected, which passes null to cmo · Emptying...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
Uncaught TypeError: Cannot read property 'opacity' of ...
Troubleshooting - Uncaught TypeError: Cannot read property 'opacity' of undefined - Only solid blue color when I publish.
Read more >
Avoiding those dang cannot read property of undefined errors
Uncaught TypeError: Cannot read property 'foo' of undefined. ​ The dreaded error we all hit at some point in JavaScript development.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found