Giter VIP home page Giter VIP logo

Comments (6)

frankwallis avatar frankwallis commented on June 10, 2024

This is a limitation in SystemJS, see systemjs/builder#242.

from plugin-typescript.

guybedford avatar guybedford commented on June 10, 2024

Are you saying here mymodule.ts works while mymodule.module.ts doesn't? What is it trying to find in this case that throws?

from plugin-typescript.

 avatar commented on June 10, 2024

@guybedford Yes that's what I'm saying. It thinks .module is the extension and since JS is a default extension it does mymodule.module.ts.js

from plugin-typescript.

guybedford avatar guybedford commented on June 10, 2024

@robertbaker thanks so much - ok this sounds like a bug. I've posted a possible fix in systemjs/systemjs@bb5430a. Do you think you could try replacing that in your system.src.js and seeing if it helps?

from plugin-typescript.

 avatar commented on June 10, 2024
GET http://localhost:3010/app/app.module.js 404 (Not Found)fetchTextFromURL @ system.src.js:1021SystemLoader.fetch @ system.src.js:1054SystemLoader.fetch @ system.src.js:1053calledRegister @ system.src.js:1523(anonymous function) @ system.src.js:2038loader @ system.src.js:2269loader @ system.src.js:2806loader @ system.src.js:3308constructor.meta @ system.src.js:3375(anonymous function) @ system.src.js:3593(anonymous function) @ system.src.js:320
Not Found: http://localhost:3010/app/app.module.js
    Error loading http://localhost:3010/app/app.module.js from http://localhost:3010/src/main.ts
    Error loading http://localhost:3010/app/app.module.js

my structure /src/app & /src/common
my main.ts

///<reference path="typings\angularjs\angular.d.ts"/>
///<reference path="typings\angular-ui-router\angular-ui-router.d.ts"/>
import {appModule} from 'app/app.module';
angular.element(document).ready(() => {
    angular.bootstrap(document.body, [appModule.name], {
        strictDi: true
    });
});

my app/app.module.ts:

///<reference path="..\typings\angularjs\angular.d.ts"/>
///<reference path="..\typings\angular-ui-router\angular-ui-router.d.ts"/>
import 'angular';
import 'angular-ui-router';
//import 'angular-material';
//import 'angular-animate';

import 'angular-messages';
//import 'ng-click-select';
import 'ng-fittext';
import 'ng-slide-down';
import 'angular-moment';
import 'angular-numbro';
import 'robertbaker/angular-credit-cards';
import 'app/templates';

import reflexModule from 'common/reflex/reflex.module';
import 'common/reflex/setup/schema';

import commonModule from 'common/common.module';

import 'app/app.css!';
import {IAppStorageService, default as dep} from 'common/services/appStorage.service';

import {setupModule} from 'app/setup/setup.module';
// import {loginModule} from 'app/login/loginModule';
// import {logoutModule} from 'app/logout/logoutModule';
// import {settingsModule} from 'app/settings/settingsModule';
import {dashboardModule} from 'app/dashboard/dashboard.module';
// import {customerModule} from 'app/customer/customerModule';
// import {inventoryModule} from 'app/inventory/inventoryModule';
// import {transactionModule} from 'app/transaction/inventoryModule';

export interface IAppScopeService extends ng.IRootScopeService {
    title: string;
}

export var appModule = angular.module('app', [
    'app.templates',
    commonModule.name,
    'ui.router',
    'ngMessages',
    'ngNumbro',
    'ngFitText',
    //'ngAnimate',
    //'ngClickSelect',
    'ng-slide-down',
    'angularMoment',
    'credit-cards', /* https://www.npmjs.com/package/angular-credit-cards */
    reflexModule.name,
    dep.name,
    dashboardModule.name,
    setupModule.name
]);

export default appModule;

my config.js

System.config({
  "defaultJSExtensions": true,
  "transpiler": "typescript",
  "babelOptions": {
    "optional": [
      "runtime"
    ]
  },
  "typescriptOptions": {
    "noImplicitAny": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "typeCheck": true
  },
  "paths": {
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*",
    "app": "src"
  },
  "packages": {
    "app": {
      "main": "main",
      "defaultExtension": "ts",
        "meta": {
            "*.ts": {
                "loader": "ts"
            },
            "*.css": {
                "loader": "css"
            },
            "*.json": {
                "loader": "json"
            },
            "*.html": {
                "loader": "text"
            }
        }
    }
  },
  "buildCSS": true,
  "separateCSS": false
});

the first few errors are this plugin because I'm not using ///reference paths. ( @frankwallis please add tsconfig support)

first error is systemjs. I made the change in system.src and in my index I'm using that file.

It seems that this plugin does not support the ES6 style imports. @frankwallis

from plugin-typescript.

guybedford avatar guybedford commented on June 10, 2024

@robertbaker the behaviour is actually by design now - app.module already has an extension so won't get .ts added automatically. Files that already have . in them need to have explicit extensions. This is described in the packages configuration documentation https://github.com/systemjs/systemjs/blob/master/docs/config-api.md#packages.

The bug fix has worked here then, thanks for helping to spot that.

from plugin-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.