Closed dessalines closed 8 years ago
Hey @tchoulihan. Did you follow the steps that are provided on the wiki?
@jkuri , I didn't see that. I assumed it was just a problem with this library, since I randomly tried ng install moment
and I didn't need to do any of that.
Actually I just looked over the 3rd party libs page, it looks like its out of date. For example, the system-config.js
file is used now as opposed to the script, and the syntax looks quite different.
@tchoulihan yes, please update your angular-cli
version, seems like you are using very outdated one.
My ang-version is
angular-cli: 0.0.33
node: 5.10.1
os: linux x64
Version 0.0.34 just got pushed 5 hours ago.
Are the docs correct for 0.0.34
, and not 0.0.33
?
I can verify that the wiki docs are not correct for this new version, the system-config.js
is still being used.. I still need help with this issue.
Sorry, my mistake then, I will update the wiki docs and let you know.
No problem, thanks.
@tchoulihan I just updated the docs, please let me know if now works for you. Thanks for notify about outdated docs.
Thanks!
@jkuri Tried the updated docs, also didn't work, getting the same error as above. The broccoli compiler seems to work fine, but the console in the browser gives the error:
Unhandled Promise rejection: "XHR error (404 Not Found) loading http://localhost:4200/vendor/markdown-it/markdown.js
Error loading http://localhost:4200/vendor/markdown-it/markdown.js as "markdown-it" from http://localhost:4200/app/ang-cli-test-2.component.js"
The issue seems to be in the system-config.ts
file:
// Add your custom SystemJS configuration here.
export const config: any = {
packages: Object.assign({
// Add your custom SystemJS packages here.
}, createPackageConfig(barrels)),
map: {
'markdown-it': 'vendor/markdown-it/markdown.js'
}
};
I've tried lots of combinations of this. The actual js file is located at node_modules/markdown-it/dist/markdown.js
, but I've tried that, and many other combinations such as markdown-it/dist/markdown.js
, but they all give the same error.
@tchoulihan the docs includes the examples, you must set paths that fits your library, I guess in your case would be;
vendorNpmFiles: ['markdown-it/dist/markdown.js']
map: {
'markdown-it': 'vendor/markdown-it/dist/markdown.js'
}
Just check the paths where the .js
file is located.
Oops my bad, I didn't realize the location was right there in the vendor folder. Sorry about that. It would be useful to include that in the docs for adding 3rd party libraries, since each one might be in a different location.
No problem, does it works now for you?
Oops sorry, should've said that it does. Thanks a bunch.
Hi I am getting the same error. Is there any solution?
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
I can't seem to get the library
markdown-it
to work. I've installed it through npm, and the typings, so there are no typescript compiler errors.ng-serve
runs fine with no errors, but I get the following error in the console:Which tells me that angular-cli isn't bundling it correctly.
My import statement is:
import * as markdownIt from 'markdown-it';
, and I said, the typescript compiler is recognizing it.Env:
Thanks.