question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

incompatible with angular >= 6.0.0

See original GitHub issue

Subject of the issue

Because json-schema-ref-parser requires node http & https, it cannot be used in Angular applications that use angular-cli >= 6.0.0

See this comment from angular-cli: angular/angular-cli#9827 (comment)

Your environment

angular>= 6.0

Expected behavior

I can use json-schema-ref-parser in my app and ng serve does not fail

Actual behavior

ng serve fails with

ERROR in ./node_modules/json-schema-ref-parser/lib/resolvers/http.js
Module not found: Error: Can't resolve 'http' in '/Users/web/container-web/node_modules/json-schema-ref-parser/lib/resolvers'
ERROR in ./node_modules/json-schema-ref-parser/lib/resolvers/http.js
Module not found: Error: Can't resolve 'https' in '/Users/web/container-web/node_modules/json-schema-ref-parser/lib/resolvers'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
johnzondrcommented, Feb 12, 2021

i got it working, add this to package.json & reinstall:

"browser": { "http": false, "https": false }

and add this to polyfill.ts

(window as any).process = require('process/browser');
(window as any).global = window;
2reactions
TimUnderhaycommented, Nov 2, 2020

For those who don’t require resolution of external references, it shouldn’t be a requirement at all to load any http module, which causes needless bundle bloat. It should be optional.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm - When upgrading Angular 5 to 6, I get incompatible peer ...
ng update @angular/core Package "@angular/flex-layout" has an incompatible peer dependency to "rxjs" (requires "^5.5.0", would install "6.2.0").
Read more >
ng upgrade: incompatible peer dependency error prevents ...
Try upgrading the Angular dependencies, using for instance ng update @angular/core . I already performed the @angular/cli upgrade command which ...
Read more >
Upgrade Angular App to latest version - Medium
Package "@angular/fire" has an incompatible peer dependency to "@angular/common" (requires ">=6.0.0 <8" (extended), would install "11.1.1").
Read more >
could not resolve dependency: npm err! peer @angular/core ...
When I try to update @angular/cdk or other packages I usually get a message saying the dependencies are incompatible (see error block).
Read more >
Angular Update Guide
We are deprecating support for @angular/platform-webworker , as it has been incompatible with the CLI. Running Angular's rendering architecture in a web ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found