Skip to content

bromzh/ng2-aot-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to reproduce compilation issue

Case 1: npm link

How to reproduce.

Ensure that AOT works.

Step 1. Build a lib

cd ng2-lib
npm i
npm run build

Step 2. Then build an app

cd ../ng2-app
npm i
npm run aot

It must be ends succesfully.

Crashing compilation

Step 3. Link the lib

cd ng2-lib
npm link

Step 4. And plug linked lib

cd ../ng2-app
npm link ng2-lib
npm run aot

Compilation crashes.

Case 2: Different dependencies

You have different deps versions in your lib and app. When you install lib dependency, there are node_modules

How to reproduce

Ensure that AOT works

Step 1. Build a lib

cd ng2-lib
npm i
npm run build

Step 2. build an app

cd ../ng2-app
npm i
npm run aot

It must be ends succesfully.

Crashing compilation

Step 3. Change lib's dependencies. For example, you may checkout to deps branch:

git checkout deps
cd ng2-lib
rm -rf node_nodules
npm run clean
npm i
npm run build

Step 4. Re-install lib

cd ../ng2-app
npm run clean
npm i
npm run aot

For now you have 2 node_modules directories with angular 2 modules:

  1. In your app: ng2-app/node_modules/@angular/core. Version - 2.2.1.
  2. In your lib: ng2-app/node_modules/ng2-app/node_modules/@angular/core . Version - 2.2.0.

Compilation crashes.

Step 4.1. But if remove ng2-app/node_modules/ng2-lib/node_nodules directory, compilation returns to normal:

rm -rf node_nodules/ng2-lib/node_modules
npm run aot

In this case compilation still crashes even if we have same deps versions for lib and app, but lib contains node_modules directory. Details in 3rd case.

Case 3: lib and app have same deps versions but lib have inner node_modules dir

Compilation crashes even if you has same deps for app and lib, but for some reasons you have inner node_modules in lib. For example, this may occurs when you update deps versions in app or lib, but didn't clean app's node_modules dir after this.

How to reproduce

Step 1. First, reproduce 2nd case until step 4 (without 4.1)

Step 2. Change app deps versions

cd ng2-app
sed -i -e 's/2.2.1/2.2.0/g' package.json # or whatever
npm i
npm run aot

For now you have 2 node_modules directories with angular 2 modules:

  1. In your app: ng2-app/node_modules/@angular/core. Version - 2.2.0.
  2. In your lib: ng2-app/node_modules/ng2-app/node_modules/@angular/core. Version - 2.2.0.

Compilation crashes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published