Home > Blockchain >  ReferenceError: crossOriginIsolated is not defined whenever I run "npm run server"
ReferenceError: crossOriginIsolated is not defined whenever I run "npm run server"

Time:07-04

Whenever I run "npm run server" in the terminal I get this error

This is my package.json file:

{
  "scripts": {
    "start": "node backend/server.js",
    "server": "node backend/server.js"
  },
  "dependencies": {
    "colors": "^1.4.0",
    "dotenv": "^16.0.1",
    "express": "^4.18.1",
    "mongoose": "^6.4.2"
  },
  "devDependencies": {
    "nodemon": "^2.0.18"
  }
}

This is my server.js file"

crossOriginIsolated.log('Hello World')

CodePudding user response:

Did you mean to do:

console.log("Hello World")

instead of

crossOriginIsolated.log('Hello World')

Maybe Intellisense made you enter the wrong thing.

CodePudding user response:

Answered: The server.js file had the wrong code, I had a plugin that auto adds code and I missed it here:

crossOriginIsolated.log('Hello World')
->
console.log('Hello World')
  • Related