cookies icon indicating copy to clipboard operation
cookies copied to clipboard

Wrong load path on Ivy compiler

Open adrdilauro opened this issue 5 years ago • 0 comments

I have a module on npm that depends on @ngx-utils/cookies, and people are complaining that it raises an error on the new Ivy compiler.

This is the full error I get

ERROR in ./node_modules/angular-ab-tests/__ivy_ngcc__/fesm5/angular-ab-tests.js 464:41-57
"export 'CookiesService' (imported as 'CookiesService$1') was not found in '@ngx-utils/cookies'
ERROR in ./node_modules/angular-ab-tests/__ivy_ngcc__/fesm5/angular-ab-tests.js 466:227-243
"export 'CookiesService' (imported as 'CookiesService$1') was not found in '@ngx-utils/cookies'
ERROR in ./node_modules/angular-ab-tests/__ivy_ngcc__/fesm5/angular-ab-tests.js 472:38-54
"export 'CookiesService' (imported as 'CookiesService$1') was not found in '@ngx-utils/cookies'
ERROR in ./node_modules/@ngx-utils/cookies/__ivy_ngcc__/index.js
Module not found: Error: Can't resolve './src/cookies-options.service' in '[path-to-project]/project-sample/node_modules/@ngx-utils/cookies/__ivy_ngcc__'
ERROR in ./node_modules/@ngx-utils/cookies/__ivy_ngcc__/index.js
Module not found: Error: Can't resolve './src/cookies.service' in '[path-to-project]/project-sample/node_modules/@ngx-utils/cookies/__ivy_ngcc__'

I don't know how the content of the folder __ivy_ngcc__ is generated, but I see that there is an error in

/__ivy_ngcc__/index.js

The content of that file is

export * from './src/cookies.service';
export * from './src/cookies-options.service';

which fails because it tries to load things from a non existing folder src/ inside __ivy_ngcc__ itself.

Correcting it this way it works

export * from '../src/cookies.service';
export * from '../src/cookies-options.service';

I am a bit lost, is this caused by @nx-utils/cookies, or it's a problem with how I configured the Ivy compiler?

Thanks in advance for the help

adrdilauro avatar Jun 12 '19 22:06 adrdilauro