Vercel deployment, enviormental variables - node.js

Hey guys im trying to deploy my website and I keep getting stuck on these issues vercel build then vercel deploy -- prebuilt I get the error message of Error: ENOENT: no such file or directory, stat '/vercel/path0/.vercel/output/functions/_next/data/f3doRdmrRJC9QWLs2rG4w/index.json.func'
But when I run vercel deploy depending on my environmental variables for NEXT_PUBLIC_BASE_URL if I put http://portfolio-build-lem0bum28-bchang0999.vercel.app as my value the result i get is Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error FetchError: invalid json response body at https://vercel.com/login?next=%2Fdeployments%2Fportfolio-build-lem0bum28-bchang0999.vercel.app%3Fhost%3Dportfolio-build-lem0bum28-bchang0999.vercel.app%26redirect%3D1%26section%3D reason: Unexpected token < in JSON at position 0
if i put the NEXT_PUBLIC_BASE_URL with a value of http://localhost:3000 the error code I get is FetchError: request to http://localhost:3000/api/getPageInfo failed, reason: connect ECONNREFUSED 127.0.0.1:3000
any help to resolve this so I can deploy and move on from this project would be nice
http://portfolio-build-lem0bum28-bchang0999.vercel.app errorlocalhost:3000 error

Related

pushing to Heroku error: Module not found: Error: Can't resolve './components/Header/' in '/tmp/build_0b321d16/client/src'

I am currently trying to push my app to heroku and it's giving me the following error in console:
for some reason my header component won't resolve, this is how I imported it in react:
import Header from "./components/Header/";
I checked the path and it should work, I'm not sure why it is giving me an error. This site was built with the mern stack.

how can I handle response error in expo app

I'm working on an app using React Native and Expo. I'm not new to react native, but this is the first job that required the use of expo. My problem is I'm sending error messages from the server that would be usefull for front end logic, but expo constantly overrides the error with an error that Expo generates, and I can't figure out how to retreive the message from the server.
Server code:
...Random server logic
return res.status(400).json({ msg: "invalid user credentials" });
What I receive in the expo app.
message(pin):"Request failed with status code 402"
name(pin):"Error"
stack(pin):"Error: Request failed with status code 402 at createError (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:176428:17) at settle (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:176418:14) at EventTarget.handleLoad (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:176316:9) at EventTarget.dispatchEvent (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:32785:27) at EventTarget.setReadyState (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31854:14) at EventTarget.__didCompleteResponse (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31696:16) at http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31806:47 at RCTDeviceEventEmitter.emit (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:7450:37) at MessageQueue.__callFunction (http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:3225:44) at http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2938:17"

Heroku: “No default language could be detected for this app” error thrown for node app

I am trying to deploy my api on heroku using github but i get this message. I also tried heroku cli but i got the same error message.
This is my package.json
This is my folder structure

Error: ENOOET: no such file or directory

I have small problem. In my nodejs/express application i use the passport-local strategy for processing authorization information. Recently I began to receive a message in the my nodejs console:
Error: ENOENT: no such file or directory, chmod, rename
'C:\olympus\SRC\Gui\app\sessions\WCe9twVKOmignsse_g3H4Uyml2ACz1W5.json.790444257'
-> 'C:\olympus\SRC\Gui\app\sessions\WCe9twVKOmignsse_g3H4Uyml2ACz1W5.json'
at Error (native)
This is very annoying.
How can I remove this messages from my console?

Nodejitsu while while starting node.js app

I am very new to node.js, I just followed the steps to create a simple node.js application. Here it is on github
I ran the command jitsu deploy from the terminal to deploy it on nodejitsu, however I got this error right here, please any help on what could be wrong with code files?
Here is the code on git hub
Here is the error that is appearing:
prompt: Is this ok?: (yes) yes
info: Creating snapshot 0.0.0-5
info Uploading: [=============================] 100%
info: Updating app test
info: Activating snapshot 0.0.0-5 for test
info: Starting app test
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy the app
error:
error: Error spawning drone
error: Script took too long to listen on a socket
error:
error: This type of error is usually a user error.
error: Error output from Haibu:
error:
error: Error: Error spawning drone
error: at Object.onTimeout [as _onTimeout] (/root/haibu-orchestra/node_mod
ules/haibu/lib/haibu/core/spawner.js:396:15)
error: at Timer.list.ontimeout (timers.js:101:19)
help: For help with this error contact Nodejitsu Support:
help: webchat: <http://webchat.nodejitsu.com/>
help: irc: <irc://chat.freenode.net/#nodejitsu>
help: email: <support#nodejitsu.com>
You're server.js is exporting a function, but that doesn't get run. Just the body of your start function as top-level code directly inside the server.js module so that it executes when nodejitsu starts your application.
Nodejitsu is very picky about how quick your deployments listen on the system. There is a certain time frame between the start of deployment and end of deployment before your deployment is considered a failure. When it doesn't listen on a port for so long, it ends up giving you this error.
Rather than using your current start function, why don't you try creating your HTTP socket in index.js and then passing it into your start function as well, since you're already passing routes and handle to it?
For example, in index.js:
var http = require('http'),
server = http.createServer().listen(8080);
start(server, router.route, handle);
Then, rather than using http.createServer(onRequest).listen(8080) in your server.js file, you can use something like:
var start = function (server, route, handle) {
function onRequest(request, response) {
/* Your request stuff here */
}
server.on('request', onRequest);
};
This would most likely solve the whole problem.

Resources