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

http and https module issue with angular 18.2 #372

Open
ashishsharma229 opened this issue Feb 26, 2025 · 0 comments
Open

http and https module issue with angular 18.2 #372

ashishsharma229 opened this issue Feb 26, 2025 · 0 comments

Comments

@ashishsharma229
Copy link

ashishsharma229 commented Feb 26, 2025

I am trying to upgrade my angular application from angular 16 to angular 18. This @apidevtools/json-schema-ref-parser is coming from swagger-parser in my application and i am using v10.0.3 of it.

I updated @angular-devkit/build-angular to 18.2.8 version. When i am trying to serve the application using ng serve command i am getting following error

✘ [ERROR] Could not resolve "http"

    node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/http.js:3:21:
      3 │ const http = require("http");
        ╵                      ~~~~~~

  The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "https"

    node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/http.js:4:22:
      4 │ const https = require("https");
        ╵                       ~~~~~~~

  The package "https" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

I already added http and https in browser list in package.json but as expected it is not helping at all.

"browser": {
  "fs": false,
  "path": false,
  "os": false,
  "process": false,
  "crypto": false,
  "http": false,
  "https": false
}

My few Angular dependencies are

"@angular/animations": "18.2.8",
"@angular/cdk": "18.2.8",
"@angular/common": "18.2.8",
"@angular/compiler": "18.2.8",
"@angular/core": "18.2.8",
"@angular/elements": "18.2.8",
"@angular/forms": "18.2.8",
"@angular/localize": "18.2.8",
"@angular/platform-browser": "18.2.8",
"@angular/platform-browser-dynamic": "18.2.8",
"@angular/router": "18.2.8",
"http-browserify": "^1.7.0",
"https-browserify": "^1.0.0",
"crypto-browserify": "^3.12.0",
"swagger-parser": "10.0.3",

and few dev-dependencies

"@angular-devkit/build-angular": "18.2.8",
"@angular-devkit/core": "18.2.8",
"@angular-devkit/schematics": "18.2.8",
"@angular-eslint/builder": "18.3.0",
"@angular-eslint/eslint-plugin": "18.3.0",
"@angular-eslint/eslint-plugin-template": "18.3.0",
"@angular-eslint/schematics": "18.3.0",
"@angular-eslint/template-parser": "18.3.0",
"@angular/cli": "18.2.8",
"@angular/compiler-cli": "18.2.8",
"@angular/language-service": "18.2.8",
"stream-browserify": "^3.0.0",

Can someone please help?

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