14

I am getting the following warning when I am building the application with Angular Cli version 9.1.7 with enableIvy. I am using ag-grid-community version 22.1.0.

Warning: Unable to fully load /node_modules/ag-grid-angular/main.js for source-map flattening: ENOENT: no such file or directory, open '/node_modules/ag-grid-angular/exports.js.map

Application is running fine but still like to know, is this issue from ag-grid side? I didn't check ag-grid 23 version, so can this issue be resolved or not arise on the latest version. Thoughts..

Sanj
  • 141
  • 1
  • 5
  • this issue is still happening for angular version 9.1.11. The warning is coming during the compilation of typescript sources through ngc. The following message is showing on the console "Compiling ag-grid-angular : main as commonjs" then the warning is coming. – Sanj Jul 10 '20 at 10:42
  • Different from this context, another warning is coming during ng build "Warning: Entry point 'ngx-papaparse' contains deep imports into '/node_modules/papaparse/papaparse.min.js'. This is probably not a problem, but may cause the compilation of entry points to be out of order. " but this issue is already recognized by ngx-papaparse stakeholders and they are already in the process to fix it. – Sanj Jul 10 '20 at 10:47
  • I'm getting this error with different dependencies and with Angular 11 – benshabatnoam Dec 13 '20 at 11:10

3 Answers3

17

For me, the command npm dedupe solved the problem.

Description of npm dedupe

Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages.

https://docs.npmjs.com/cli/dedupe

AFetter
  • 3,355
  • 6
  • 38
  • 62
Michael Mairegger
  • 6,833
  • 28
  • 41
8

My experience and https://github.com/angular/angular/issues/35757 suggest deleting node_modules folder and package-lock.json file fixes this issue.

Spikolynn
  • 4,067
  • 2
  • 37
  • 44
  • 1
    I'm seeing the same warning. It seems that everything is working, but I would like to get rid of this warning.... – Daniel C. Jul 01 '20 at 07:54
  • 1
    Yeah it seems after runing `ng update --all` the warnings came back. Re-deleting `node_modules` and `package-lock` cleared the warnings but it is not a viable solution for me :/ – Spikolynn Jul 01 '20 at 12:17
  • 1
    Actually we can see this warning during ng build after fresh npm install. This will happen only when we build with ivy compiler, during this process ivy compiler compiles all those packages to esm5/esm2015 – Sanj Jul 10 '20 at 10:56
  • @Sanj I had the same issue exactly after a fresh `npm install`. The second time doing `ng build` has no warnings – Junlong Wang Jan 13 '21 at 19:21
1

Deleting the node_modules and having the folder recreated automatically by running "npm install" did it for me.