Comments (6)
This is a limitation in SystemJS, see systemjs/builder#242.
from plugin-typescript.
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.
@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.
@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.
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.
@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)
- 7.x branch not on npm? HOT 1
- Unexpected export encountered on abstract classes HOT 3
- defaulting to tsconfig: true HOT 6
- tslib_1.__metadata is not a function HOT 2
- Plugin-Typescript doesn't completely strip out Interface import/exports which breaks rollup. HOT 12
- no such file or directory: `plugin-typescript/lib.js` HOT 7
- exports is not defined HOT 3
- js error when loading - cannot read property 'length' of undefined HOT 6
- ENOENT: no such file or directory HOT 1
- Systemjs builder output not working as expected HOT 2
- No console output from Typescript compilation errors HOT 1
- Lookup error at node v8.1.2 npm 5.0.3 HOT 2
- Support for "module": "ESNext" HOT 1
- Not compatible with Typescript 2.6.x package HOT 1
- Getting "Cannot read property 'map' of undefined" HOT 1
- Is it possible to load global script? HOT 6
- tsconfig extends HOT 3
- Error: require is not defined HOT 8
- Does not work with typescript 2.9.1 and above HOT 1
- Getting errors during npm install
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-typescript.