Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find STATUS_CODES #87

Open
ishandutta2007 opened this issue Aug 25, 2023 · 2 comments
Open

Can't find STATUS_CODES #87

ishandutta2007 opened this issue Aug 25, 2023 · 2 comments

Comments

@ishandutta2007
Copy link

ishandutta2007 commented Aug 25, 2023

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
Copy link
Author

tried this didnt work

@ishandutta2007
Copy link
Author

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',
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant