Velidan Velidan - 1 year ago 88
TypeScript Question

typescript can't find module for system.js alias

I am working with angular2 and when I created some aliases to modules via System.js (for example)

map: {
'%cool_modules%' : prodFolderName + '/modules',

and when I tried to import {MyModule} from '%cool_modules%', I got an error about: typescript: can't find module %cool_modules%

The same for @angular/core , rx/Obserable erc.

Is it possible to fix it? Thanks

Answer Source

You need to edit your tsconfig.json to recognize your alias:

    "compilerOptions": {
        "paths": {
            "@angular/core": [
            "rxjs/*": [
            "systemjs": [
            "zone.js": [
            "%cool_modules%": [
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download