title: SyntaxError: Unexpected token " in JSON at position 0
body: <p>I have an error with request to express. I have this fetch:</p>
  <pre><code>fetch(`http://localhost:4200/dist/js/server.min.js`, {
      method: &quot;POST&quot;,
      // mode: 'no-cors',
      headers: {
        &quot;Content-Type&quot;: &quot;application/json&quot;,
      },
      body: JSON.stringify(`&lt;html&gt;&lt;body&gt;&lt;div style=&quot;background-color: yellow;&quot;&gt;&lt;p&gt;Hello World!&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;`),
    }).then((response) =&gt; {
        console.log(response)
    })
  </code></pre>
  <p>And I have such a code for my express server:</p>
  <pre><code>const { exec }   = require(&quot;child_process&quot;),
        express    = require(&quot;express&quot;),
        bodyParser = require('body-parser'),
        webshot    = require('webshot'),
        PORT       = 4200,
        app        = express(),
        cors       = require('cors')
  
  // app.use(cors())
  
  app.use((req, res, next) =&gt; {
      res.append('Access-Control-Allow-Origin', 'http://localhost:4242');
      res.append('Access-Control-Allow-Methods', 'POST', 'GET', 'OPTIONS');
      res.append('Access-Control-Allow-Headers', 'Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
      res.append('Access-Control-Allow-Credentials', 'true');
      next();
      
  });
  
  // app.use(express.json());
  app.use(bodyParser.json());
  
  app.get('/dist/js/server.min.js', (req, res) =&gt; {
      res.send('&lt;h1&gt;Hello&lt;/h1&gt;')
  })
  
  app.post('/', function(req, res) {
      htmlData = req.body
      screen(htmlData) // just my function
  });
  
  app.listen(PORT, () =&gt; {
      console.log(`What's my age again? ${PORT}, I guess.`)
  });
  </code></pre>
  <p>And I've got this error in browser:</p>
  <pre><code>POST http://localhost:4200/dist/js/server.min.js 400 (Bad Request)
  </code></pre>
  <p>And this in console:</p>
  <pre><code>SyntaxError: Unexpected token &quot; in JSON at position 0
      at JSON.parse (&lt;anonymous&gt;)
      at createStrictSyntaxError (/home/joe/Documents/vscode-projects/html-projects/swipeskins/node_modules/body-parser/lib/types/json.js:158:10)
      at parse (/home/joe/Documents/vscode-projects/html-projects/swipeskins/node_modules/body-parser/lib/types/json.js:83:15)
      at /home/joe/Documents/vscode-projects/html-projects/swipeskins/node_modules/body-parser/lib/read.js:121:18
      at invokeCallback (/home/joe/Documents/vscode-projects/html-projects/swipeskins/node_modules/body-parser/node_modules/raw-body/index.js:224:16)
      at done (/home/joe/Documents/vscode-projects/html-projects/swipeskins/node_modules/body-parser/node_modules/raw-body/index.js:213:7)
      at IncomingMessage.onEnd (/home/joe/Documents/vscode-projects/html-projects/swipeskins/node_modules/body-parser/node_modules/raw-body/index.js:273:7)
      at IncomingMessage.emit (events.js:198:15)
      at endReadableNT (_stream_readable.js:1139:12)
      at processTicksAndRejections (internal/process/task_queues.js:81:17)
  </code></pre>
  <p>I guess, server has problems with parsing json data. But why? What is wrong with code?</p>
  <p>Thanks a lot for your time, I would be very grateful to hear something from you if you have some thoughts about my situation.</p>