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

package.json in the npm package has unwanted IVY metadata #112

Closed
monstrege opened this issue Jul 3, 2019 · 11 comments
Closed

package.json in the npm package has unwanted IVY metadata #112

monstrege opened this issue Jul 3, 2019 · 11 comments

Comments

@monstrege
Copy link

monstrege commented Jul 3, 2019

Hi,

I finally figured what a bug I was experiencing since a few days was.

I was getting this when I was trying to ng build --prod with ivy in angular 8 :

ERROR in The ngcc compiler has changed since the last ngcc build.
Please completely remove `node_modules` and try again.

which I did many times without success...

I finally found out that the culprit was the ngx-permission package.json that has some ivy compiler metadata inside.

Especially this part:

"__processed_by_ivy_ngcc__": {
    "fesm2015": "8.0.0",
    "typings": "8.0.0",
    "fesm5": "8.0.0",
    "es2015": "8.0.0",
    "esm2015": "8.0.0",
    "esm5": "8.0.0",
    "module": "8.0.0"
  },

This part should just be local data, and not be something included in the npm package. (from my too small knowledge about it)

I'm not blaming anyone here :)

I just don't think that the ivy compiler should change the file and add some garbage metadata inside the package.json like that.

Can anyone remove the __processed_by_ivy_ngcc__ part from the npm package?

Thanks alot!

@monstrege
Copy link
Author

Temporary workaround is to change

"__processed_by_ivy_ngcc__": {
    "fesm2015": "8.0.0",
    "typings": "8.0.0",
    "fesm5": "8.0.0",
    "es2015": "8.0.0",
    "esm2015": "8.0.0",
    "esm5": "8.0.0",
    "module": "8.0.0"
  }

and put your active angular version. 8.0.3 in my case at the moment.

This is located in ./node-modules/ngx-permissions/package.json

@AlexKhymenko
Copy link
Owner

@monstrege Hi thank You. I will look into it but just to be honest ivy is kinda broken on 8 hopefully will be fixed :-)

@petebacondarwin
Copy link

@monstrege - if you were deleting the node_modules folder and reinstalling the ngx-permissions package, why did it still contain the ngcc marker data? Are you saying that the published file contains these markers?

@petebacondarwin
Copy link

Oh I see that the published package.json file does indeed have these markers!!
https://unpkg.com/ngx-permissions@7.0.2/package.json

@AlexKhymenko
Copy link
Owner

AlexKhymenko commented Jul 8, 2019

@petebacondarwin i have rebuild with newest version but its still contains markers


"module_ivy_ngcc": "__ivy_ngcc__/fesm5/ngx-permissions.js",
  "__processed_by_ivy_ngcc__": {
    "module": "8.1.0",
    "typings": "8.1.0"
  } 

Using angular cli 8.1.0
ang angualr 8.1.0

is it ok?? Or i should change something?

@petebacondarwin
Copy link

Don't run ivy-ngcc on the code that you publish. ngcc is a tool for consumers of your library to use.

@petebacondarwin
Copy link

There should be no such markers in the package.json files that you publish to npm.

@AlexKhymenko
Copy link
Owner

@petebacondarwin Thank You now i understand. When im creating new version it doesn't have ngcc markers. But then im testing that everything works fine in the app and on this moment its adding this markers.

@AlexKhymenko
Copy link
Owner

AlexKhymenko commented Jul 8, 2019

@monstrege Fix in version 7.0.3 Please can You verify if everything is ok :-) Reopen the issue if there is a problem please :-)

@petebacondarwin
Copy link

Cool!

@monstrege
Copy link
Author

monstrege commented Jul 8, 2019

@AlexKhymenko Thx!
Also, I believe that those tags will be ok when ivy will work, but not at the moment.
EDIT:
It works well now :)

This issue was closed.
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

3 participants