あるSEのつぶやき・改

ITやシステム開発などの技術に関する話題を、取り上げたりしています。

Fix: Erorr occurred React + HTTPS in development environment

A below error occurred React + HTTPS in development environment.

ts-loader: Using typescript@3.3.4000 and C:\Users\xxx\Projects\react-cognito\tsconfig.json
internal/buffer.js:788
class FastBuffer extends Uint8Array {}
^

RangeError: Invalid typed array length: -4095
    at new Uint8Array (<anonymous>)
    at new FastBuffer (internal/buffer.js:788:1)
    at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:149:17)
    at Stream.<anonymous> (C:\Users\xxx\Projects\react-cognito\node_modules\handle-thing\lib\handle.js:120:12)
    at Stream.emit (events.js:198:15)
    at endReadableNT (C:\Users\xxx\Projects\react-cognito\node_modules\readable-stream\lib\_stream_readable.js:1010:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)

npm ERR! Windows_NT 10.0.17763
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v-x64\\11.13.0\\node.exe" "C:\\Program Files (x86)\\Nodist\\npmv\\4.0.5\\bin\\npm-cli.js" "start"
npm ERR! node v11.13.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! react-cognito@0.1.0 start: `react-scripts-ts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-cognito@0.1.0 start script 'react-scripts-ts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-cognito package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts-ts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-cognito
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-cognito
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\xxx\Projects\react-cognito\npm-debug.log

I worried about it so much, but finally I recognized this cause.

This error's cause is TypeScript version.

So I downgraded TypeScript version 11.13.0 to 10.10.0.

Although this error did not occur, but another error occurred.

The error is below.

internal/stream_base_commons.js:62
  var err = req.handle.writev(req, chunks, allBuffers);
                       ^

TypeError: req.handle.writev is not a function
    at writevGeneric (internal/stream_base_commons.js:62:24)
    at Socket._writeGeneric (net.js:711:5)
    at Socket._writev (net.js:720:8)
    at doWrite (_stream_writable.js:408:12)
    at clearBuffer (_stream_writable.js:517:5)
    at Socket.Writable.uncork (_stream_writable.js:314:7)
    at connectionCorkNT (_http_outgoing.js:641:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)

npm ERR! Windows_NT 10.0.17763
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v-x64\\10.10.0\\node.exe" "C:\\Program Files
(x86)\\Nodist\\npmv\\4.0.5\\bin\\npm-cli.js" "start"
npm ERR! node v10.10.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! react-cognito@0.1.0 start: `react-scripts-ts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-cognito@0.1.0 start script 'react-scripts-ts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-cognito package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts-ts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-cognito
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-cognito
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\xxx\Projects\react-cognito\npm-debug.log
True

The error's cause is TypeScript version, too.

So I downgraded TypeScript version 10.10.0 to 7.2.1.

No errors have occurred now!

I was exhausted but happy. :-)