Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

upgrading to 2.0.0-rc.3 from 1.1.1 generate errors #168

Open
t246246 opened this issue Jun 20, 2016 · 20 comments
Open

upgrading to 2.0.0-rc.3 from 1.1.1 generate errors #168

t246246 opened this issue Jun 20, 2016 · 20 comments

Comments

@t246246
Copy link

t246246 commented Jun 20, 2016

As I have just update to 2.0.0-rc-3, it begin to generate errors. With 1.1.1 no errors at all.

I tried with typescript 1.8.10 and 1.9.0-dev, both generate same errors.
I use webpack.2.1.0-beta.13. Source is angular hero demo.

@angular/core is 2.0.0-rc2, @angular-router is @3.0.0-alpha.7

$ npm run build

> [email protected] build /Users/t246246/work/plunk
> webpack --define process.env.NODE_ENV="production" --env.production

{ options: 
   { target: 2,
     module: 5,
     moduleResolution: 2,
     sourceMap: true,
     emitDecoratorMetadata: true,
     experimentalDecorators: true,
     removeComments: false,
     noImplicitAny: false,
     suppressImplicitAnyIndexErrors: false,
     declaration: false },
  fileNames: 
   [ '/Users/t246246/work/plunk/app/app.component.ts',
     '/Users/t246246/work/plunk/app/app.routes.ts',
     '/Users/t246246/work/plunk/app/auth.guard.ts',
     '/Users/t246246/work/plunk/app/auth.service.ts',
     '/Users/t246246/work/plunk/app/dialog.service.ts',
     '/Users/t246246/work/plunk/app/interfaces.ts',
     '/Users/t246246/work/plunk/app/login.component.ts',
     '/Users/t246246/work/plunk/app/login.routes.ts',
     '/Users/t246246/work/plunk/app/main.ts',
     '/Users/t246246/work/plunk/app/crisis-center/crisis-admin.component.ts',
     '/Users/t246246/work/plunk/app/crisis-center/crisis-center.component.ts',
     '/Users/t246246/work/plunk/app/crisis-center/crisis-center.routes.ts',
     '/Users/t246246/work/plunk/app/crisis-center/crisis-detail.component.ts',
     '/Users/t246246/work/plunk/app/crisis-center/crisis-list.component.ts',
     '/Users/t246246/work/plunk/app/crisis-center/crisis.service.ts',
     '/Users/t246246/work/plunk/app/heroes/hero-detail.component.ts',
     '/Users/t246246/work/plunk/app/heroes/hero-list.component.ts',
     '/Users/t246246/work/plunk/app/heroes/hero.service.ts',
     '/Users/t246246/work/plunk/app/heroes/heroes.routes.ts' ],
  typingOptions: { enableAutoDiscovery: false, include: [], exclude: [] },
  errors: [] } {}
Hash: 49021769bc99d9fb7295
Version: webpack 2.1.0-beta.13
Time: 12971ms
           Asset    Size  Chunks             Chunk Names
vendor.bundle.js   12 MB       0  [emitted]  vendor
       bundle.js  109 kB       1  [emitted]  app
[1195] multi app 28 bytes {1} [built]
[1196] multi vendor 172 bytes {0} [built]
    + 1195 hidden modules

ERROR in [default] /Users/t246246/work/plunk/app/app.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/auth.guard.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Injectable'.

ERROR in [default] /Users/t246246/work/plunk/app/auth.service.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Injectable'.

ERROR in [default] /Users/t246246/work/plunk/app/auth.service.ts:13:22 
Property 'of' does not exist on type 'typeof Observable'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-admin.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-center.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-detail.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-detail.component.ts:1:20 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnInit'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-detail.component.ts:1:28 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnDestroy'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-detail.component.ts:80:23 
Property 'fromPromise' does not exist on type 'typeof Observable'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-list.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-list.component.ts:1:20 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnInit'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-list.component.ts:1:28 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnDestroy'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis.service.ts:14:8 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Injectable'.

ERROR in [default] /Users/t246246/work/plunk/app/dialog.service.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Injectable'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero-detail.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero-detail.component.ts:1:20 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnInit'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero-detail.component.ts:1:28 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnDestroy'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero-list.component.ts:2:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero-list.component.ts:2:20 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnInit'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero-list.component.ts:2:28 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'OnDestroy'.

ERROR in [default] /Users/t246246/work/plunk/app/heroes/hero.service.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Injectable'.

ERROR in [default] /Users/t246246/work/plunk/app/login.component.ts:1:9 
Module '"/Users/t246246/work/plunk/node_modules/@angular/core/index"' has no exported member 'Component'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:6:14 
Cannot find module './src/metadata'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:7:14 
Cannot find module './src/util'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:8:14 
Cannot find module './src/di'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:9:157 
Cannot find module './src/application_ref'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:10:80 
Cannot find module './src/application_tokens'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:11:14 
Cannot find module './src/zone'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:12:14 
Cannot find module './src/render'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:13:14 
Cannot find module './src/linker'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:14:72 
Cannot find module './src/debug/debug_node'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:15:14 
Cannot find module './src/testability/testability'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:16:14 
Cannot find module './src/change_detection'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:17:14 
Cannot find module './src/platform_directives_and_pipes'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:18:14 
Cannot find module './src/platform_common_providers'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:19:14 
Cannot find module './src/application_common_providers'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:20:89 
Cannot find module './src/profile/profile'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:21:37 
Cannot find module './src/facade/lang'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:22:29 
Cannot find module './src/facade/async'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:23:66 
Cannot find module './src/facade/exceptions'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:24:14 
Cannot find module './private_export'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:25:14 
Cannot find module './src/animation/metadata'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/core/index.d.ts:26:32 
Cannot find module './src/animation/animation_player'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/platform-browser-dynamic/index.d.ts:1:51 
Cannot find module '@angular/core'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:1:27 
Cannot find module './directives/router_link'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:2:33 
Cannot find module './directives/router_link_active'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:3:29 
Cannot find module './directives/router_outlet'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:4:29 
Cannot find module './common_router_providers'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:5:36 
Cannot find module './config'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:6:43 
Cannot find module './interfaces'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:7:115 
Cannot find module './router'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:8:32 
Cannot find module './router_outlet_map'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:9:30 
Cannot find module './router_providers'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:10:89 
Cannot find module './router_state'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:11:39 
Cannot find module './shared'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:12:52 
Cannot find module './url_serializer'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/@angular/router/index.d.ts:13:43 
Cannot find module './url_tree'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/Observable.d.ts:1:32 
Cannot find module './Observer'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/Observable.d.ts:2:25 
Cannot find module './Operator'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/Observable.d.ts:3:27 
Cannot find module './Subscriber'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/Observable.d.ts:4:67 
Cannot find module './Subscription'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/Observable.d.ts:5:29 
Cannot find module './observable/IfObservable'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/Observable.d.ts:6:32 
Cannot find module './observable/ErrorObservable'.

fileNames entry in log is OK, but it somehow failed to exclude modules defined in tsconfig.json.
(If I write files instead of exclude, same error occurs, so there should be other cause.)

tsconfig.json

{
    "compilerOptions": {
        "target": "es2015",
        "module": "es2015",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "suppressImplicitAnyIndexErrors": false,
        "declaration": false
    },
    "compileOnSave": false,
    "buildOnSave": false,
    "exclude": [
        "node_modules",
        "typings"
    ]
}

Here is my webpack.config.js:

const path = require('path');
const webpack = require('webpack');

function root(p) {
    return path.resolve(__dirname, p);
}

module.exports = function(env) {
    const config = {
        context: root('app'),
        entry: {
            app: [
                './main.ts'
            ],
            vendor: [
                'core-js/shim', 'es6-shim',
                'reflect-metadata', 'zone.js',
                '@angular/common', /* '@angular/compiler',*/ '@angular/core', '@angular/forms',
                '@angular/http', '@angular/forms',
                /* '@angular/platform-browser', */
                '@angular/platform-browser-dynamic',
                '@angular/router', '@angular/router-deprecated', /* '@angular/upgrade',*/
                'rxjs/Rx' /* ,'primeng/primeng', /* 'primeui/primeui', 'ng2-file-upload' */
            ]
        },
        output: {
            path: root('dist'),
            publicPath: '/dist',
            filename: 'bundle.js'
        },
        resolve: {
            modules: [
                root('app'),
                'node_modules',
            ],
            extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
        },
        module: {
            loaders: [
                {
                    test: /\.ts$/,
                    exclude: /node_modules/,
                    loader: 'babel-loader!awesome-typescript-loader'
                }, {
                    test: /\.json$/,
                    loader: 'json-loader'
                }, {
                    test: /\.html$/,
                    exclude: /node_modules/,
                    loader: 'raw-loader'
                }
            ],
            preLoaders: [{
                test: /\.js$/,
                loader: 'source-map-loader',
                exclude: [root('node_modules/rxjs')/*, root('node_modules/primeng')*/]
            }]
        },
        devServer: {
            historyApiFallback: true,
            hot: true,
            progress: true,
        },
        debug: true,
        plugins: [
            new webpack.optimize.CommonsChunkPlugin({
                name: 'vendor',
                minChunks: Infinity,
                filename: 'vendor.bundle.js'
            }),
            new webpack.LoaderOptionsPlugin({
                minimize: true,
                debug: false
            })
        ]
    };

    if (env && env.production) {
        // console.log('production mode');
        // production
        config.devtool = 'inline-source-map';
        config.plugins.push.apply([
            //production only
            new webpack.DefinePlugin({
                "process.env": {
                    // This has effect on the react lib size
                    "NODE_ENV": JSON.stringify("production")
                }
            }),
            new webpack.optimize.DedupePlugin(),
            new webpack.optimize.UglifyJsPlugin({
                beautify: false,
                mangle: false,
                comments: false,
                compress: {
                    screw_ie8: true
                },
                sourceMap: false
            })
        ]);
        return config;
    }

    config.devtool = 'eval-source-map';

    return config;
}

Sorry if I am missing something.
Best wishes,

@s-panferov
Copy link
Owner

@t246246 thanks for your request. I wanted to note that 2.0.0 is an experimental version so everything can happen :-) I'll try to debug your case. Could you please put some links to the sources?

@t246246
Copy link
Author

t246246 commented Jun 20, 2016

Thank you for your prompt reply. I added the link for plnker. That is not webpack one, so I need to add webpack.config above myself. Also this is for @angular/router-3.0.0-alpha-6 so runtime error occurs if you run it with alpha-7, but anyway it is compile time error, so I think it is not important for now.

2016/6/22 edit
Now https://angular.io/resources/live-examples/router/ts/plnkr.html is for alpha-7 that works.

I add my other files:
package.json

{
  "name": "primeng-quickstart-webpack",
  "version": "v1.0.0-SNAPSHOT",
  "scripts": {
    "postinstall": "npm run typings -- install",
    "typings": "typings",
    "build": "webpack --define process.env.NODE_ENV=\"production\" --env.production",
    "start": "webpack-dev-server --hot --inline"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.2",
    "@angular/compiler": "2.0.0-rc.2",
    "@angular/core": "2.0.0-rc.2",
    "@angular/forms": "^0.1.0",
    "@angular/http": "2.0.0-rc.2",
    "@angular/platform-browser": "2.0.0-rc.2",
    "@angular/platform-browser-dynamic": "2.0.0-rc.2",
    "@angular/router": "3.0.0-alpha.7",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.2",
    "core-js": "^2.4.0",
    "es6-shim": "^0.35.1",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.9",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
    "awesome-typescript-loader": "^2.0.0-rc.3",
    "babel-core": "^6.9.1",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015-native-modules": "^6.6.0",
    "del": "^2.2.0",
    "gulp": "^3.9.1",
    "gulp-util": "^3.0.7",
    "http-server": "^0.9.0",
    "json-loader": "^0.5.4",
    "npm-check-updates": "^2.6.7",
    "script-loader": "^0.7.0",
    "source-map-loader": "^0.1.5",
    "ts-loader": "^0.8.2",
    "typescript": "^1.8.10",
    "typings": "^1.3.0",
    "webpack": "^2.1.0-beta.13",
    "webpack-dev-server": "^2.1.0-beta.0"
  }
}

.babelrc

{
        "presets": ["es2015-native-modules"]
}

and I modified index.html.

<!DOCTYPE html>
<html>
<html>
  <head>
    <base href="." />
    <title>Router Sample</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="styles.css">
  </head>

  <body>
    <my-app>loading...</my-app>
    <script src="dist/vendor.bundle.js"></script>
    <script src="dist/bundle.js"></script>
  </body>

</html>

@niieani
Copy link

niieani commented Jun 20, 2016

HI @s-panferov. I'm getting similar errors related to bad module-resolution with 2.0.0.

ERROR in [default] aurelia/skeleton-navigation/skeleton-webpack-typescript/custom_typings/system.d.ts:4:27
Cannot find module 'aurelia-framework'.

ERROR in [default] aurelia/skeleton-navigation/skeleton-webpack-typescript/node_modules/aurelia-bootstrapper-webpack/dist/aurelia-bootstrapper-webpa
ck.d.ts:4:7
Cannot find module 'aurelia-pal-browser'.

...and so on. The same tsconfig.json works flawlessly when typechecking is run from within Visual Studio Code or when run with tsc -p ..

I'm using: moduleResolution: "node" in my tsconfig -- the d.ts which seem to be missing are the ones that should be resolved by TypeScript automatically (non-ambient typings, declared in package.json in the field typings.json).

@s-panferov
Copy link
Owner

@niieani thanks for your report, is your project open-source? Can I see the source-codes?

@olegstepura
Copy link

Hi, @s-panferov!

Same here for moduleResolution: "node" in 2.0.0-rc.3:
I use "absolute paths" in my project and get these errors:

ERROR in [default] [stripped]/common/util/consoleHelper.ts:1:30
Cannot find module './apiMethods'.

ERROR in [default] [stripped]/common/util/consoleHelper.ts:4:27
Cannot find module 'common/constant/EntryPoint'.

... and so on ...

First import is written as
import { apiMethodList } from './apiMethods',
second one:
import { EntryPoint } from 'common/constant/EntryPoint'

This should work since I got "rootDir": "src/main", in tsconfig.json

This all worked with ts-loader, just wanted to switch to awesome-typescript loader (upgrading node produced errors with ts-loader, wanted to check how things work here).

@niieani
Copy link

niieani commented Jun 20, 2016

@s-panferov The simplest way to reproduce the error is to simply:

  1. create a new project, adding aurelia-framework as a dependency,
  2. making sure you have moduleResolution: "node" set in tsconfig.json.
  3. create an index.ts file with import {inject} from 'aurelia-framework'.

VSCode and TSC will compile that file without errors, while the loader will complain about missing aurelia-framework.

@s-panferov
Copy link
Owner

@niieani your case fixed in v2.0.0-rc.4.

Everybody please try v2.0.0-rc.4

@niieani
Copy link

niieani commented Jun 20, 2016

@s-panferov It's mostly fixed, however there's one more case that doesn't work.
Add a custom_typing.d.ts file to my example:

declare module 'system' {
  import * as Aurelia from 'aurelia-framework';
  interface System {
    import(name: 'aurelia-framework'): Promise<typeof Aurelia>;
  }
}

this still generates an error:

ERROR in [default] /aurelia/skeleton-navigation/skeleton-webpack-typescript/custom_typings/system.d.ts:4:27
Cannot find module 'aurelia-framework'.

@olegstepura
Copy link

For me v2.0.0-rc.4 seem to be the same

@s-panferov
Copy link
Owner

@niieani thanks, I've fixed your case in v2.0.0-rc.5.

@olegstepura I'll try to debug your case soon.

@t246246
Copy link
Author

t246246 commented Jun 20, 2016

In v2.0.0-rc.4, errors reduced. Same with 2.0.0-rc.5 and 2.0.0-rc.6. Remaining errors are:

ERROR in [default] /Users/t246246/work/plunk/app/auth.service.ts:13:22 
Property 'of' does not exist on type 'typeof Observable'.

ERROR in [default] /Users/t246246/work/plunk/app/crisis-center/crisis-detail.component.ts:80:23 
Property 'fromPromise' does not exist on type 'typeof Observable'.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/observable/from.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/observable/fromPromise.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/observable/of.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/concat.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/concatMap.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/delay.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/do.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/every.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/map.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/mergeAll.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/mergeMap.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

ERROR in [default] /Users/t246246/work/plunk/node_modules/rxjs/add/operator/scan.d.ts:2:15 
Invalid module name in augmentation, module '../../Observable' cannot be found.

PS. I had added wrong links for angular demo. Current one at my first comment is correct. Sorry.
You can see app/auth.service.ts now.

PPS.
If I tried with Windows instead of MacOS X, errors are different:

Using typescript 1.8.0

ERROR in [default] C:/work/plunk/app/app.component.ts:1:35
Cannot find module '@angular/core'.

ERROR in [default] C:/work/plunk/app/app.component.ts:2:35
Cannot find module '@angular/router'.

ERROR in [default] C:/work/plunk/app/app.component.ts:4:31
Cannot find module './dialog.service'.

    [skip many others]

Using typescript 1.9.0-dev.20160620-1.0 different kind of error happened, I sepatate it to another issue #170

@s-panferov
Copy link
Owner

@t246246 Your issues might be fixed by 2.0.0-rc.7, everything compiles correctly (on MacOS, I'll try on Windows later as well).

This error:

Invalid module name in augmentation, module '../../Observable' cannot be found.

This seems to be related to microsoft/TypeScript#8518, so it seems that you need to use typescript@next to compile this project.

@s-panferov
Copy link
Owner

@t246246 also please take a note, that this setup

babel-loader!awesome-typescript-loader

can be replaced with more performant

awesome-typescript-loader?+useBabel&+useCache

This will work faster because it will cache result files and will not trigger TS and Babel emit if nothing changed.

@olegstepura
Copy link

Hi, @s-panferov!

I created a test repo for tests https://github.com/olegstepura/awesome-typescript-loader-test
Seems like everything is compiled (browser displays the App), but in console I see this (awesome-typescript-loader is 2.0 beta 10)

default] Checking started in a separate process...
[default] C:/Temp/awesome-test/src/main/App.tsx:2:23
    Cannot find module 'some/name/space/Test1'.
[default] C:/Temp/awesome-test/src/main/index.tsx:4:21
    Cannot find module './App'.
[default] C:/Temp/awesome-test/src/main/index.tsx:11:8
    JSX element type 'RootComponent' does not have any construct or call signatures.
[default] C:/Temp/awesome-test/src/main/some/name/space/Test1.tsx:2:23
    Cannot find module 'some/other/ns/Test2'.

Plus initial compilation is extremely slow. Please try checking it on your side.

@olegstepura
Copy link

Also I should note that this [default] prefix in console is very confusing. I suggest stating that this message was from awesome-typescript-loader, even better if is would contain some context info (to understand why this happends: e.g. typescript compilation error or resolver error...)

@s-panferov
Copy link
Owner

@t246246 your setup fixed on Windows in [email protected]. Can you please try?

@t246246
Copy link
Author

t246246 commented Jun 23, 2016

Thank you! I confirmed it works on Windows and MacOS X.

@s-panferov
Copy link
Owner

@olegstepura could you please try [email protected] for your case?

@olegstepura
Copy link

I tried using [email protected]

[awesome-typescript] Checking started in a separate process...
[awesome-typescript] C:\Temp\awesome-test\src\main\App.tsx:2:23
    Cannot find module 'some/name/space/Test1'.
[awesome-typescript] C:\Temp\awesome-test\src\main\some\name\space\Style.css.d.ts:1:28
    Initializers are not allowed in ambient contexts.
[awesome-typescript] C:\Temp\awesome-test\src\main\some\name\space\Test1.tsx:2:23
    Cannot find module 'some/other/ns/Test2'.

With [email protected] it's still the same. Please feel free to git clone my test repo and try it yourself.

@olegstepura
Copy link

@s-panferov Please also note I'm on Windows.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants