Skip to content
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

covalent not working #30

Open
Tenvan opened this issue May 22, 2017 · 9 comments
Open

covalent not working #30

Tenvan opened this issue May 22, 2017 · 9 comments

Comments

@Tenvan
Copy link
Contributor

Tenvan commented May 22, 2017

hi,
the next problem:
i use covalent in my solution, and now the following error raises:

Uncaught SyntaxError: Unexpected token import
todo.service.ts:5 Uncaught ReferenceError: FuseBox is not defined
    at todo.service.ts:5
(anonymous) @ todo.service.ts:5

brach 'feature/covalent' in my fork shows this:
https://github.com/Tenvan/angular2-example/tree/feature/covalent

@nchanged
Copy link
Contributor

And a transpiled snippet please, it must be something simple

@Tenvan
Copy link
Contributor Author

Tenvan commented May 22, 2017

just bundle.. the error comes also without the use of some component.

@Tenvan
Copy link
Contributor Author

Tenvan commented May 22, 2017

the covalent bundles contains 'import'-statements, which are only allowed in source-head... thats the problem...

@nchanged
Copy link
Contributor

ok you either find an offending line and paste here, or wait until i get there ;-)

@Tenvan
Copy link
Contributor Author

Tenvan commented May 22, 2017

ok.. here (line 118365 in my bundle):

...
___scope___.file("loading/services/loading.factory.js", function(exports, require, module, __filename, __dirname){

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Injectable, ComponentFactoryResolver } from '@angular/core';
import { Injector } from '@angular/core';
import { TemplatePortal, Overlay, OverlayState, ComponentPortal } from '@angular/material';
import { Subject } from 'rxjs/Subject';
import { TdLoadingComponent, LoadingStyle } from '../loading.component';
/**
 * NOTE: @internal usage only.
 */
var TdLoadingFactory = (function () {
    function TdLoadingFactory(_componentFactoryResolver, _overlay, _injector) {
        this._componentFactoryResolver = _componentFactoryResolver;
        this._overlay = _overlay;
        this._injector = _injector;
    }
...

or search for 'import { TdLoadingComponent'

@Tenvan
Copy link
Contributor Author

Tenvan commented May 22, 2017

this is the complete module-code from covalent for the loading-module:

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MdProgressBarModule, MdProgressSpinnerModule, OverlayModule, PortalModule } from '@angular/material';
import { TdLoadingService } from './services/loading.service';
import { TdLoadingFactory } from './services/loading.factory';
import { TdLoadingDirective } from './directives/loading.directive';
import { TdLoadingComponent } from './loading.component';
var TD_LOADING = [
    TdLoadingComponent,
    TdLoadingDirective,
];
var TD_LOADING_ENTRY_COMPONENTS = [
    TdLoadingComponent,
];
export { LoadingType, LoadingMode, LoadingStrategy } from './loading.component';
export { TdLoadingService } from './services/loading.service';
var CovalentLoadingModule = CovalentLoadingModule_1 = (function () {
    function CovalentLoadingModule() {
    }
    /**
     * @deprecated in 1.0.0-beta.3
     *
     * Please use without calling forRoot()
     */
    CovalentLoadingModule.forRoot = function () {
        return {
            ngModule: CovalentLoadingModule_1,
            providers: [],
        };
    };
    return CovalentLoadingModule;
}());
CovalentLoadingModule = CovalentLoadingModule_1 = __decorate([
    NgModule({
        imports: [
            CommonModule,
            MdProgressBarModule,
            MdProgressSpinnerModule,
            OverlayModule,
            PortalModule,
        ],
        declarations: [
            TD_LOADING,
        ],
        exports: [
            TD_LOADING,
        ],
        providers: [
            TdLoadingFactory,
            TdLoadingService,
        ],
        entryComponents: [
            TD_LOADING_ENTRY_COMPONENTS,
        ],
    })
], CovalentLoadingModule);
export { CovalentLoadingModule };
var CovalentLoadingModule_1;
//# sourceMappingURL=loading.module.js.map

all covalent modules contains import-statements..

@nchanged
Copy link
Contributor

Ok here

@nchanged
Copy link
Contributor

Look up for Why aren't my node modules transpiled?

@Tenvan
Copy link
Contributor Author

Tenvan commented May 22, 2017

ok, working now...
important: tsconfig option 'noEmitHelpers' must be 'false' for working

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

No branches or pull requests

2 participants