SyntaxError: Unexpected token '?' node_modules\babel-plugin-twin\index.js:15 - reactjs

````your text ERROR in ./app/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\babel-plugin-twin\index.js:15
const matchedExclude = (state.opts.exclude ?? []).find((regex) =>
SyntaxError: Unexpected token '?'
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at requireModule (C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\files\plugins.js:165:12)
at loadPlugin (C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\files\plugins.js:68:17)
at createDescriptor (C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\config-descriptors.js:154:9)
at C:\Users\Projects\Multipayment\sample-browser-ui\src\node_modules\#babel\core\lib\config\config-descriptors.js:109:50
# multi ./node_modules/react-app-polyfill/ie11.js webpack-hot-middleware/client?reload=true react-hot-loader/patch ./app/app.js main[3]
Getting error on npm start `

Related

Discord.js error '.addChoice' is not a function

i have some Problems with my Code that somehow none of my friends have ...
Some Code to see:
module.exports = {
data: new SlashCommandBuilder()
.setName('equipment')
.setDescription('Gives you Information about specific Equipments')
.addStringOption(option =>
option.setName('type')
.setDescription('Specify the Equipment')
.setRequired(true)
.addChoice('Flashlight', 'flashlight')
),
...
The Code is Cut here because its not necesery for it above to work.
My Error Code:
PS C:\Users\enric\Desktop\Ghosty Phasmo Help> node .
C:\Users\enric\Desktop\Ghosty Phasmo Help\commands\phasmo\equipment.js:15
.addChoice('Flashlight', 'flashlight')
^
TypeError: option.setName(...).setDescription(...).setRequired(...).addChoice is not a function
at C:\Users\enric\Desktop\Ghosty Phasmo Help\commands\phasmo\equipment.js:15:18
at MixedClass._sharedAddOptionMethod (C:\Users\enric\Desktop\Ghosty Phasmo Help\node_modules\#discordjs\builders\dist\index.js:1334:50)
at MixedClass.addStringOption (C:\Users\enric\Desktop\Ghosty Phasmo Help\node_modules\#discordjs\builders\dist\index.js:1323:17)
at Object.<anonymous> (C:\Users\enric\Desktop\Ghosty Phasmo Help\commands\phasmo\equipment.js:11:7)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
Somehow my Discord.js thinks that im using a Function. I copied the Code from other friends where this completely work. but somehow the same Error message appears.
.addChoice() is outdated. Now, there is only .addChoices() (with an s)
.addStringOption(option =>
option.setName('type')
.setDescription('Specify the Equipment')
.setRequired(true)
.addChoices({
name: 'Flashlight',
value: 'flashlight'
})
)

TypeError: Cannot read properties of undefined (reading 'set') (discord.js)

Im trying to make a discord music bot and i have to admit that i dont have much knowledge on javascript so im just following a tutorial. Now this is the code he wrote
const slashFiles = fs.readdirSync("./slash").filter(file => file.endsWith(".js"))
for (const file of slashFiles){
const slashcmd = require(`./slash/${file}`)
client.toLocaleLowerCase.set(slashcmd.data.name, slashcmd)
if (LOAD_SLASH) commands.push(slashcmd.data.toJSON())
}
and thats the error im getting
client.toLocaleLowerCase.set(slashcmd.data.name, slashcmd)
^
TypeError: Cannot read properties of undefined (reading 'set')
at Object.<anonymous> (C:\Users\stelj\Desktop\bot\main.js:31:30)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Pls help

node:internal/modules/cjs/loader:936 Eror

I'm getting this error:
I tried to install Npm again, if anyone comes across I would be happy to help
node:internal/modules/cjs/loader:936
throw err;
^
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\yehon\\OneDrive\\שולחן העבודה\\yehonatan\\Work_projects\\Manhattan-client-13-03-2022_v2\\config\\paths.js',
'C:\\Users\\yehon\\OneDrive\\שולחן העבודה\\yehonatan\\Work_projects\\Manhattan-client-13-03-2022_v2\\config\\env.js',
'C:\\Users\\yehon\\OneDrive\\שולחן העבודה\\yehonatan\\Work_projects\\Manhattan-client-13-03-2022_v2\\scripts\\start.js'
]
}

npm start command giving cannot find module 'isexe' error

C:\Users\bahub\Documents\React-Projects\contact-manager-app>npm start
contact-manager-app#0.1.0 start
react-scripts start
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'isexe'
Require stack:
C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\which\which.js
C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\cross-spawn\lib\util\resolveCommand.js
C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\cross-spawn\lib\parse.js
C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\cross-spawn\index.js
C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\react-dev-utils\crossSpawn.js
C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\react-scripts\bin\react-scripts.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\which\which.js:10:13)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\which\which.js',
'C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\cross-spawn\lib\util\resolveCommand.js',
'C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\cross-spawn\lib\parse.js',
'C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\cross-spawn\index.js',
'C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\react-dev-utils\crossSpawn.js',
'C:\Users\bahub\Documents\React-Projects\contact-manager-app\node_modules\react-scripts\bin\react-scripts.js'
]
}

Unexpected token export after updating reactjs and nextjs

I updated my version of reactJS from v15.6.1 to v16.0 and Next.js from 3.2.2 to 4.0.0-beta.2.
I run my npm run dev as usual and I got this message error:
Internal Server Error
An internal server error occurred.
Unexpected token export
/Users/pierre/Desktop/TAP-WEBAPP/.next/dist/css/main.scss:1
(function (exports, require, module, __filename, __dirname) { export default "#charset \"UTF-8\";\n.ease-in, .navbar__main__section:hover, .nav__chapter--isSelected {\n transition: all 100ms cubic-bezier(0.42, 0, 1, 1);\n /* ease-in */ }\n\n.ease-out, .navbar__main__section {\n transition: all 100ms cubic-bezier(0, 0, 0.58, 1);\n /* ease-out */ }\n\n.swift-in {\n transition: all 3000ms cubic-bezier(0, 0, 0.58, 1); }\n\n/*!\n * Font Awesome 4.7.0 by #davegandy - http://fontawesome.io - #fontawesome\n * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n */\n/* FONT PATH\n * -------------------------- */\n#font-face {\n font-family: 'FontAwesome';\n src: url(\"../fonts/fontawesome-webfont.eot?v=4.7.0\");\n src: url(\"../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0\") format(\"embedded-opentype\"), url(\"../fonts/fontawesome-webfont.woff2?v=4.7.0\") format(\"woff2\"), url(\"../fonts/fontawesome-webfont.woff?v=4.7.
SyntaxError: Unexpected token export
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:588:28)
at Module._compile (/Users/pierre/Desktop/TAP-WEBAPP/node_modules/source-map-support/source-map-support.js:492:25)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/pierre/Desktop/TAP-WEBAPP/components/General/Header.js:5:1)
at Module._compile (module.js:624:30)
at Module._compile (/Users/pierre/Desktop/TAP-WEBAPP/node_modules/source-map-support/source-map-support.js:492:25)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
Any ideas whats wrong there?
Next.js 4 is out of the beta. Had a similar issue and upgrading to next.js 4 fixed it. Could you upgrade from the beta with
$ npm install next#latest --save
and report back?

Resources