Error: Cannot find module "@angular/core/src/metadata/di"

Hello everyone, hope you are good,
I find this error and I didn’t find to good solution of it, I spend a lot of time
thanks for help

Error: Uncaught (in promise): Error: Cannot find module "@angular/core/src/metadata/di"
Error: Cannot find module "@angular/core/src/metadata/di"
    at Object.276 (http://localhost:8100/build/4.js:48:7)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.270 (http://localhost:8100/build/4.js:11:64)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at http://localhost:8100/build/main.js:54:10
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
    at Object.onInvoke (http://localhost:8100/build/vendor.js:4979:33)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
    at r.run (http://localhost:8100/build/polyfills.js:3:10143)
    at http://localhost:8100/build/polyfills.js:3:20242
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at Object.reject (http://localhost:8100/build/polyfills.js:3:19174)
    at NavControllerBase._fireError (http://localhost:8100/build/vendor.js:48008:16)
    at NavControllerBase._failed (http://localhost:8100/build/vendor.js:48001:14)
    at http://localhost:8100/build/vendor.js:48048:59
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
    at Object.onInvoke (http://localhost:8100/build/vendor.js:4979:33)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
    at r.run (http://localhost:8100/build/polyfills.js:3:10143)
    at http://localhost:8100/build/polyfills.js:3:20242
Ionic Framework: 3.9.2
Ionic App Scripts: 3.1.0
Angular Core: 5.0.0
Angular Compiler CLI: 5.0.0
Node: 6.5.0
OS Platform: Windows 7
Navigator Platform: Win32
1 Like

Hello again, I find the solution,

I check my code, and the IDE are imported automaticty import { ViewChild } from '@angular/core/src/metadata/di'

So if you find this error try to check your code

see you

4 Likes

Thanks had the same issue

Hi there,

I don’t understand your solution. Should import { ViewChild } be included or left out? Thanks

Thank you very much for that! A bit of a lack of attention on my part I suppose.

You must import like this
import { Component, ViewChild } from ‘@angular/core’;

1 Like