Facing Error in Sanity like Unhandled Runtime Error - next.js

New with sanity
But facing a issue while trying to run with my project. I have latest version of sanity installed globally. but Every time i run my project I am facing this Error message
Unhandled Runtime Error
Error: Bad Request
Please upgrade to latest version of the Sanity CLI using `npm install -g #sanity/cli` and run `sanity login` to re-authenticate
Call Stack
Object.eval [as callback]
node_modules/#sanity/client/lib/http/request.js (46:0)
cbOnce
node_modules/#bjoerge/xhr/index.js (62:0)
loadFunc
node_modules/#bjoerge/xhr/index.js (138:0)
XMLHttpRequest.readystatechange
node_modules/#bjoerge/xhr/index.js (68:0)
I run this npm install -g #sanity/cli command many times but no progress..
My node -v is 16

Related

Problem starting Next.js app at locallhost 7777 using yarn dev

When I try to run my localhost using yarn dev it shows this error:
yarn run v1.22.4 $ next -p 7777 ready - started server on
0.0.0.0:7777, url: http://localhost:7777 TypeError: _jestWorker.Worker is not a constructor
at Object.loadWebpackHook (D:\isc-web\isc-front\node_modules\next\dist\server\config-utils.js:67:20)
at Object.loadConfig [as default] (D:\isc-web\isc-front\node_modules\next\dist\server\config.js:332:29)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async NextServer.loadConfig (D:\isc-web\isc-front\node_modules\next\dist\server\next.js:112:22)
error Command failed with exit code 1. info Visit
https://yarnpkg.com/en/docs/cli/run for documentation about this
command.
It was all working fine before I did npm install --save-dev babel-plugin-styled-components even though I canceled the changes by using git checkout -- . but still got the same problem
If you cancelled dependency changes with git checkout your node_modules may still have the old dependencies installed. Try running npm i again to see if getting updated dependencies resolves the issue.
I can't tell much from this error message and I don't know how far along your project is... Have you seen the official Next.js + styled-components example? https://github.com/vercel/next.js/tree/canary/examples/with-styled-components
Perhaps if you try setting up the library this way instead?

'firebase init' gives me a generic error on a ionic project

I'm following a course of ionic and I need to store a picture on firebase database, at that point we should install firebase-tools, which I do by executing as admin:
npm install -g firebase-tools
But then the course says you should execute:
firebase init
and then I receive the following error:
Error: An unexpected error has occurred.
This generic error with nothing else.
Any ideas of how to solve this?
If you execute:
firebase init --debug
This gives you more info about the error.
It might be something about credentials or login information which can be solved by executing:
firebase login

How can I fix this 410 error response from Firebase hosting when deploying from Create React App? [duplicate]

this is my log :
[info] === Deploying to 'test-123'...
[info]
[info] i deploying hosting
[info] i hosting: preparing public directory for upload...
[debug] [2018-10-25T15:39:54.587Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/test-123/uploads/-LPfsRseOoTTgVVj-keR?fileCount=81&message=
Thu Oct 25 2018 21:09:54 GMT+0530 (India Standard Time)
[debug] [2018-10-25T15:40:00.337Z] <<< HTTP RESPONSE 410
[debug] [2018-10-25T15:40:00.337Z] <<< HTTP RESPONSE BODY undefined
[debug] [2018-10-25T15:40:00.339Z] TypeError: Cannot read property 'error' of undefined
at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:10:13)
at Request._callback (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:47:25)
at Request.self.callback (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
[error]
[error] Error: An unexpected error has occurred.
till yesterday everything was fine
when i deploy functions one by one or all at the same time everything works fine
please suggest something if someone knows about it
it says HTTPS ERROR 410 which i googled and found out that means the resource has moved
so the url requested might not be working but when i put that in browser its working fine
and i upgraded node, all npm modules still no luck
I found this response from the firebase-community Slack group https://firebase-community.slack.com:
If you are receiving a 410 error, you will likely need to update your cli version (firebase-tools). Updating to the latest version should fix it. You will need to upgrade your CLI version to at least 4.1.0 (>= 5.1.1 is recommended).
I was using firebase-tools: version 3.18.4 previously, and after upgrading to the latest version (5.1.1), I was able to deploy successfully:
npm install -g firebase-tools#5.1.1
For me only installing specific version worked e.g npm install -g firebase-tools#5.1.1
Update global npm "firebase-tools"
Updating firebase tools with npm update -g firebase-tools fixed this for me. I also had to close my terminal session and open a new one to use the new cli version.
My problem was using nvm the version of firebase-tools was mixed, however this npx firebase deploy worked for me.
Credit goes to heydanhey here github issue
After updating firebase I also needed to run this command.
alias firebase="`npm config get prefix`/bin/firebase"
Upgrading the dependencies for the project may help
npm install --save firebase-functions#latest
This worked for me:
Upgrade firebase npm update -g firebase-tools
Log out firebase logout
Log back in firebase login
Deploy firebase deploy

Potential conflict between polymer build and tur-nr/polymer-redux

Description
I am experiencing unexpected errors when running polymer build after installing and using tur-nr/polymer-redux. Here is the demo repo.
Versions & Environment
polymer-build: v0.18.3 polymer --version
node: v6.10.2
Operating System: macOS Sierra v10.12.4
Steps to reproduce
terminal
git clone https://github.com/maria-le/redux # clone remote repo to your local
cd redux # cd into your local repo
bower install # install bower dependencies
npm install redux # install redux
polymer build # attempt build
Expected results
I expect the build to complete, without errors. Then allow me to serve the packaged build.
Actual results
I get the following errors in the terminal.
Error messages
src/all-locally.html(14,16) error [unknown-polymer-behavior] - Unable to resolve behavior store. Did you import it? Is it annotated with #polymerBehavior?
ReduxStore
src/imported-behavior.html(7,16) error [unknown-polymer-behavior] - Unable to resolve behavior ReduxStore. Did you import it? Is it annotated with #polymerBehavior?
polymerStore
src/imported-store-as-variable.html(10,16) error [unknown-polymer-behavior] - Unable to resolve behavior polymerStore. Did you import it? Is it annotated with #polymerBehavior?
PolymerRedux(reduxStore)
src/imported-store.html(7,16) warning [could-not-determine-behavior-name] - Could not determine behavior name from expression of type
CallExpression
error: Promise rejection: Error: 3 error(s) occurred during build.
error: Error: 3 error(s) occurred during build.
at BuildAnalyzer._done (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:229:36)
at BuildAnalyzer. (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:189:26)
at next (native)
at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
References
How to use polymer-redux with polymer-build?
polymer lint and polymer-build fail due to ReduxBehavior not registering properly
#polymerBehavior should still produce a behavior even if we can't evaluate the expression

Problems starting a freshly installed Mean Stack application

I'm trying to start a new mean stack application. However i only get this error when I'm running grunt to start the server:
[nodemon] v1.2.1
Running "watch" task
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node --debug server.js`
Waiting...
Debugger listening on port 5858
Mean app started on port 3000 (development) cluster.worker.id: 0
/Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: Cannot read property 'length' of undefined
at processResults (/Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1581:31)
at /Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1619:20
at /Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1157:7
at /Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1890:9
at Server.Base._callHandler (/Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:448:41)
at /Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:481:18
at MongoReply.parseBody (/Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at null.<anonymous> (/Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:439:20)
at emit (events.js:107:17)
at null.<anonymous> (/Users/olehenrik/Sites/learn/mean_test2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)
[nodemon] app crashed - waiting for file changes before starting...
Have any one encountered this before? Can't find too many other people who have encountered this before.
I was also facing the same error and this info solves it.
"Upgrade to 3.8.23. 3.8.22 introduced better compatibility with mongodb server 3.0 by upgrading to latest version of the driver." credit to vkarpov15 from mongoose Github thread.
What I did was I edit my package.json to upgrade mongoose to "3.8.23". After I edited the package.json I ran npm install and bower install(just to make sure) again and that solved the problem.

Resources