-
Notifications
You must be signed in to change notification settings - Fork 82
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
Cannot build using AOT #17
Comments
Try to pull on the master branch as #14 solved this problem but it is not currently released on npm. package.json"angular2-markdown": "git://github.com/dimpu/angular2-markdown.git#master", Please give us a feedback if it solved your issue. |
Thanks it seems to solve the problem. Will wait for a release to change back my package.json to semver. Un bonjour de Québec ;) |
Ok I tried to build with master as version to use in package.json. I first thought it was doing the job but it was because my colleague actually removed the module form imports (to wait until the module is fixed). app.module.ts contains: and I encounter the same error than stated in the first post. I tried to remove and rebuild npm dependencies with no success. |
Sorry about that, seems #14 solved the problem for JiT but not for AoT, ill try it and come back to you shortly. |
After lots of search through Github issues I found that the problem with AoT would be related to Angular-CLI not being able to resolve node modules inside other node modules. WorkaroundI've been able to compile an application with AoT using angular2-markdown by doing some modifications to
Also I had to make a small fix in Here is the
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"mapRoot": "./",
"module": "es2015",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
],
"paths": {
+ "@angular/common": ["../node_modules/@angular/common"],
+ "@angular/compiler": ["../node_modules/@angular/compiler"],
+ "@angular/core": ["../node_modules/@angular/core"],
+ "@angular/forms": ["../node_modules/@angular/forms"],
+ "@angular/http": ["../node_modules/@angular/http"],
+ "@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
+ "@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"],
+ "@angular/router": ["../node_modules/@angular/router"],
+ "rxjs/Rx": ["../node_modules/rxjs/Rx"],
+ "rxjs/add/operator/toPromise": ["../node_modules/rxjs/add/operator/toPromise"]
}
},
"exclude": [
+ "test.ts"
],
"angularCompilerOptions": {
"genDir": "aot",
"skipMetadataEmit" : true
}
} That being said there would be a simpler way to fix the problem ... What would really fix itAngular2-Markdown would have to be transpiled to javascript with it definitely typed file when pushed on NPM. That way there would be no more problem with node modules resolving as it would be included with the bundled javascript file. As a contributor I dont have the access on NPM I can't do it myself ... |
Did you removed your branch where you used to fix the problem? |
Yes, althought this is a great third party it takes too long for pull requests to be merged and released on npm so I switched to another package (which supports AoT) : ng2-markdown-to-html. The solution is in my previous post if you want to submit the changes. |
please upgrade it to 1.3.7 |
By building Angular2 app worked perfectly until I installed angular2-markdown.
Here is the error at compilation time:
Removing the angular2-markdown module solves the problem but I need it.
The text was updated successfully, but these errors were encountered: