01alchemist / TurboScript

Super charged typed JavaScript dialect for parallel programming which compiles to WebAssembly
Apache License 2.0
493 stars 35 forks source link

Updgrading systemjs to 0.20.x causes ./bin/tc to fail #56

Closed winksaville closed 7 years ago

winksaville commented 7 years ago

I updated systemjs to =0.20.0:

  "dependencies": {
    "@types/webassembly-js-api.d.ts": "https://github.com/winksaville/webassembly-js-api.d.ts",
    "alsatian": "^1.3.0",
    "systemjs": "=0.20.0"
  },

And then reinstalled

$ npm install
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
turboscript@1.0.9-alpha /home/wink/prgs/TurboScript.myfork
├── @types/debug@0.0.29 
├── @types/node@7.0.12 
├── @types/webassembly-js-api.d.ts@1.0.0  (git+https://github.com/winksaville/webassembly-js-api.d.ts.git#0b29fcc83b97f5f2585852281acb8d186227d56f)
├─┬ alsatian@1.3.1 
│ ├─┬ @types/glob@5.0.30 
│ │ ├── @types/minimatch@2.0.29 

...

│ ├─┬ tsconfig@6.0.0 
│ │ ├── strip-bom@3.0.0 
│ │ └── strip-json-comments@2.0.1 
│ ├─┬ v8flags@2.0.12 
│ │ └── user-home@1.1.1 
│ └── yn@1.2.0 
└── typescript@2.2.2 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN turboscript@1.0.9-alpha scripts['tests'] should probably be scripts['test'].

Then rebuilt the compiler

$ npm run build

> turboscript@1.0.9-alpha build /home/wink/prgs/TurboScript.myfork
> tsc -p ./src && tsc lib/tc.ts

And then ran ./bin/tc and got the following error:

$ ./bin/tc -h
TURBO_PATH:/home/wink/prgs/TurboScript.myfork
/home/wink/prgs/TurboScript.myfork/lib/turbo.js:1
(function (exports, require, module, __filename, __dirname) { System.register("stringbuilder", [], function (exports_1, context_1) {
                                                              ^

ReferenceError: System is not defined
    at Object.<anonymous> (/home/wink/prgs/TurboScript.myfork/lib/turbo.js:1:63)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/wink/prgs/TurboScript.myfork/lib/tc.js:53:1)
    at Module._compile (module.js:571:32)

The same error happens on "systemjs": "^0.20.0" which get the latest version 0.20.12

nidin commented 7 years ago

global.System = require("systemjs") in tc.ts fixed the issue.