node.js
What Are “npm run dev” and “npm run prod”
They are indeed the scripts as defined in the package.json file as you discovered. The values are run by your shell (so, for example, bash, zsh, etc. on UNIX-like operating systems). One key thing to note is that the node_modules/.bin directory is added to PATH before executing. So, in the case of the two scripts … Read more
How to upsert new record in Prisma without an ID?
The fields in where need to be unique. If you can make some field, let’s say date @unique (date: DateTime! @unique), and use that for your where in the upsert, I think it would work (tested on my local)
Facebook-passport with JWT
The best solution I found for that problem would be to redirect to the expected page with a cookie which holds the JWT. Using res.json would only send a json response and would not redirect. That’s why the other suggested answer here would not solve the problem I encountered. So my solution would be: app.get(‘/auth/facebook/callback’, … Read more
Trying to render iframe: ancestor violates the following Content Security Policy directive: “frame-ancestors ‘none'”
The frame-ancestors value acts on the source of the iframe not the document framing it. Setting CSP on your page will have no effect on the framing. Think of frame-ancestors like X-Frame-Options on steroids: it restricts what is allowed to frame the content. Gist intentionally does not allow directly framing gists but instead provides a … Read more
OpenAI API giving error: 429 Too Many Requests
I had the same issue. The reason was that I created my API key BEFORE converting my OpenAI account to paid (adding credit card). Doesn’t matter if you only upgrade, you also need to create a new api key entirely. I created another API key AFTER I added my credit card and it worked fine!
Error npm is known not to run on Node.js v10.24.1 and how to fix it, don’t update to the latest version?
The problem for me was upgrading my global version of npm while on an incompatible version of Node (8.16.1). I tried to uninstall npm globally but that also didn’t work because I could not use the npm command. To fix it, I used nvm to switch to a compatible version of Node (nvm use 14.0.0 … Read more
Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19)
Node.js v17 moved to OpenSSL v3.0. You could try switching to v16, or set ENV NODE_OPTIONS=”–openssl-legacy-provider” in your Dockerfile, or update your start script in package.json to use react-scripts –openssl-legacy-provider start (or similar depending on your specific start script). There is an issue you can follow here: https://github.com/facebook/create-react-app/issues/11708