SyntaxError: Unexpected token '??=' Discord.JS Heroku [duplicate] - node.js

This question already has an answer here:
Discord bot on Heroku throws an error: agent ??= new https.Agent
(1 answer)
Closed last year.
When I deploy my Branch I get this error in logs
Here is the console log
Anyone can help me fix this?

Nullish assignment is first supported in Node 15. It sounds like whatever version of Node your app is using is not to that point yet.
Specify a more recent Node version for Heroku to run in your package:
"engines": {
"node": "16.x"
otherwise it uses 14 by default (which is a slightly older LTS version which does not support this relatively new syntax).

Related

Compatibility issues Node and Strapi4

allow me to walk you through some problems I'm encountering when setting up Gatsby with Strapi. Hopefully, somebody can provide me with a solution. Whenever I use the following command yarn create strapi-starter strapi-test gatsby-blog I get the following error:
So what I do next is switching to node v15 using nvm to make strapi compatible with node. The result being that some packages are being installed followed by yet another compatibility error:
Therefore, I am wondering what I am doing wrong and how to make strapi4 compatible with node without having the errors above?
Use Node.js v16 rather than v15. It should fix the issue.
Besides, it's better to use even-numbered version of Node.js, as they're LTS.

uv_os_gethostname returned ENOSYS using Vue CLI

I am installing a project in vuejs but me display this error does any idea how to solve it.
D:\> vue create crud-app
node:os:68
throw new ERR_SYSTEM_ERROR(ctx);
^
SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_gethostname returned ENOSYS (function not implemented)
at new Defaults (C:\node32\node_modules\#vue\cli\node_modules\#achrinza\node -ipc\entities\Defaults.js:26:20)
at new Parser (C:\node32\node_modules\#vue\cli\node_modules\#achrinza\node-i pc\entities\EventParser.js:8:14)
at Object.<anonymous> (C:\node32\node_modules\#vue\cli\node_modules\#achrinza\node-ipc\dao\client.js:11:19)
Judging by how the window looks in your screenshot, you might be using Windows 7.
If so, the last version of Node.js with official Windows 7 support is either v13.6.0, v13.14.0 or v14 (conflicting sources). You're using v16.14.0, which is too new.
There seems to be a workaround to install newer versions, see here: https://stackoverflow.com/a/64626035
I cannot comment on how well it works, or if it works at all.

Firebase deployment error using node 12 in vscode

I am trying to deploy a firebase project (functions/hosting) and in my functions package.json, I changed the engine to node 12 because some of my other packages required it to be at least node 12 (previously it was node 10).
When I try and deploy using vscode, I get this error:
Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "10"}. Note that Node.js 6 is now deprecated.
After spending a few hours trying to get this to work, I was able to deploy from my terminal using firebase deploy, but it's still throwing the same error when I try and deploy directly from vscode. From the firebase documentation it seems like node 12 should be available? https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version
I also ran npm install -g firebase-tools to update my firebase tools.
From the log of the failure, I am using:
2 info using npm#6.14.16
3 info using node#v12.22.12
If the package.json file in your functions dir has :
"engines": {
"node": "12"
}
Then you are fine.
Firebase supports up to Node 16.
It sounds to me like your VS Code environment has a different version of node installed than your terminal - which could also mean that you have a different (older) version of firebase-tools being used by VS Code.
To test this just run this in both your terminal and VS Code and compare the results :
node --version

Webpack Error - Uncaught SyntaxError: Invalid regular expression: /[\n\r\u2028\u2029]/: Regular expression too large

Not sure what happened, all of a sudden Webpack is throwing the following error on the dev server on npm start. Nothing changed in the webpack config for React Scripts:
Uncaught SyntaxError: Invalid regular expression: /[\n\r\u2028\u2029]/: Regular expression too large
The error is coming from chunk.js, which is not something I'm touching during development and its with the following line:
var reNewLine = /[\n\r\u2028\u2029]/g;
I've tried removing and reinstalling node modules, upgraded downgraded React and react-scripts and react dom, I've tried switching node versions with nvm, and I've tried reverting back to an earlier branch commit where I knew the app was loading fine. Nothing works. Was working on app components and then this error just started popping up randomly.
Help!!! Lol
UPDATE
So I tried pulling down a earlier version of my codebase from Github on a specific commit from a month ago, one that I know was in fact working before I pushed it, and I'm still getting the same error from webpack, which tells me this is an environment issue. I've tried cleaning the npm cache, deleting package-lock.json and package.json, reinstalling node_modules. I've tried changing the node version with nvm, using a whole other different version of node, still getting the same error from webpack in Chrome.
Any ideas?
UPDATE 2
I downgraded my versions of react, react-dom, and react scripts.
"react": "17.0.1",
"react-dom": "17.0.1",
"react-scripts": "4.0.1"
Now I'm getting the same error from webpack (Regex pattern too large), but for a different Regex pattern. Have no idea what these regexes are for, not something I wrote.
UPDATE 3
So I confirmed this is an issue when doing development in Chrome Version 95. I pulled my codebase down onto another computer that had Version 91 of Chrome installed. My app worked fine. As soon as I upgraded, the regex error started appearing on that computer as well. This is a breaking change for webpack with the newest version of Chrome.
Oddly enough, that same regex works when I launch a skeleton version of the app from months ago. Makes no sense.

why I am using different node runtime version in cloud function?

as you can see at the image above, locally I am using node v10.16.3, but from cloud function dashboard it seems I still using runtime node JS 8. is this ok ? or do make something wrong ?
According tho the documentation: "You have to set the version in the engines field in the package.json file that was created in your functions/ directory during initialization" link.
Please keep in mind that Node.js 10 runtime is currently in beta.
For example, to use only version 10, edit this line in package.json:
"engines": {"node": "10"}

Resources