Python-Tls-Client icon indicating copy to clipboard operation
Python-Tls-Client copied to clipboard

Can't find STATUS_CODES

Open ishandutta2007 opened this issue 2 years ago • 2 comments
trafficstars

package.json:

{
  "dependencies": {
    ....
    "tls-client": "^0.0.5",
  }
}

npm -v

9.6.5

node -v

v16.17.1

I am on macOS 10.13.6

I am trying to build project npm run build

"STATUS_CODES" is not exported by "__vite-browser-external", imported by "node_modules/tls-client/dist/esm/response.js".
file: /Users/ishandutta2007/Documents/Projects/GrandGPT/node_modules/tls-client/dist/esm/response.js:2:9
1: import { TLSClientException } from "./exceptions";
2: import { STATUS_CODES } from "http";
            ^
3: class Response {
4:     url;
error during build:
RollupError: "STATUS_CODES" is not exported by "__vite-browser-external", imported by "node_modules/tls-client/dist/esm/response.js".

ishandutta2007 avatar Aug 25 '23 15:08 ishandutta2007

tried this didnt work

ishandutta2007 avatar Aug 25 '23 16:08 ishandutta2007

well this worked . https://stackoverflow.com/a/70666018/865220 We have to add this to vie.config.ts:

  resolve: {
    alias: {
      http: 'rollup-plugin-node-polyfills/polyfills/http',
    }
  }

ishandutta2007 avatar Aug 25 '23 16:08 ishandutta2007