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.

working with angular 4

See original GitHub issue

After updating my project to angular 4, I get this error when trying to use custom validators:

ERROR in ./~/ng2-validation/dist/uuid/validator.js Module not found: Error: Can’t resolve ‘{project path}\node_modules@angular\core\src\facade\lang.js’ in ‘{project path}\node_modules\ng2-validation\dist\uuid’

when reinstalling ng2-validators I get this: ±- UNMET PEER DEPENDENCY @angular/common@4.0.0 ±- UNMET PEER DEPENDENCY @angular/core@4.0.0 ±- ng2-validation@3.8.0 `-- UNMET PEER DEPENDENCY zone.js@0.7.6

any advise on how to handle this?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
niboaccommented, Apr 7, 2017

this issue +1 , I am using latest version 3.9.1, but still return errors:

ERROR in ./~/ng2-validation/dist/base64/validator.js Module not found: Error: Can’t resolve ‘/Users/cb/repo/structure-product-ui/node_modules/@angular/core/src/facade/lang.js’ in ‘/Users/cb/repo/structure-product-ui/node_modules/ng2-validation/dist/base64’ @ ./~/ng2-validation/dist/base64/validator.js 4:13-38 @ ./~/ng2-validation/dist/base64/index.js @ ./~/ng2-validation/dist/index.js @ ./src/app/app.module.ts @ ./src/app/index.ts @ ./src/main.browser.ts @ multi (webpack)-dev-server/client?http://localhost:3100 ./src/main.browser.ts

ERROR in ./~/ng2-validation/dist/credit-card/validator.js Module not found: Error: Can’t resolve ‘/Users/cb/repo/structure-product-ui/node_modules/@angular/core/src/facade/lang.js’ in ‘/Users/cb/repo/structure-product-ui/node_modules/ng2-validation/dist/credit-card’ @ ./~/ng2-validation/dist/credit-card/validator.js 4:13-38 @ ./~/ng2-validation/dist/credit-card/index.js @ ./~/ng2-validation/dist/index.js @ ./src/app/app.module.ts @ ./src/app/index.ts @ ./src/main.browser.ts @ multi (webpack)-dev-server/client?http://localhost:3100 ./src/main.browser.ts `

3reactions
BallisticPaincommented, Apr 8, 2017

Wooohoo… I have a fix for anyone that’s using @AngularClass, and likely enough information that you will hopefully be able to fix yours…

I was digging around in my webpack.common.js file (located in the config folder the AC Seed) trying to fix another warning I was seeing in the compiler… I happened to notice the following code (I commented the lines to FIX this issue)…

      // Fix Angular 2
      // new NormalModuleReplacementPlugin(
      //   /facade(\\|\/)async/,
      //   helpers.root('node_modules/@angular/core/src/facade/async.js')
      // ),
      // new NormalModuleReplacementPlugin(
      //   /facade(\\|\/)collection/,
      //   helpers.root('node_modules/@angular/core/src/facade/collection.js')
      // ),
      // new NormalModuleReplacementPlugin(
      //   /facade(\\|\/)errors/,
      //   helpers.root('node_modules/@angular/core/src/facade/errors.js')
      // ),
      // new NormalModuleReplacementPlugin(
      //   /facade(\\|\/)lang/,
      //   helpers.root('node_modules/@angular/core/src/facade/lang.js')
      // ),
      // new NormalModuleReplacementPlugin(
      //   /facade(\\|\/)math/,
      //   helpers.root('node_modules/@angular/core/src/facade/math.js')
      // ),

Someone mentioned to me that @angular/core no longer had a facade directory. So when I was looking to fix my other issue, I saw this one screaming at me, and right after I had just removed the module from my project. lol

I hope this gets someone the ability to move forward!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 - Quick Guide - Tutorialspoint
Projects developed in Angular 2 will work without any issues with Angular 4. Let us now see the new features and the changes...
Read more >
Angular 4 Tutorial: Angular 4 in 20 minutes
In this tutorial, you're going to learn the fundamentals of Angular 4 in an easy and step-by-step way.
Read more >
Angular 4 | Introduction - GeeksforGeeks
New Keywords: Some new keywords like 'as' was introduced. This is generally used to store the output of a slice or a command...
Read more >
Getting started with Angular
Welcome to Angular! This tutorial introduces you to the essentials of Angular by walking you through building an e-commerce site with a catalog, ......
Read more >
Getting started with Angular 4 & best practices - Softcrylic
1) Using Angular-CLI. Every production ready code needs bundling. · 2) Using Visual Studio Code and installing 'angular2-useful-dev-extensions', ...
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