2016-09-16 47 views
1

我目前收到這些錯誤我怎樣才能解決依賴檢測打字稿可達代碼

ERROR in [default] /pipeline/source/node_modules/selenium-webdriver/node_modules/adm-zip/zipEntry.js:64:16 
Unreachable code detected. 

ERROR in [default] /pipeline/source/node_modules/selenium-webdriver/node_modules/adm-zip/zipEntry.js:110:20 
Unreachable code detected. 

這裏的拉動DEPS是英寸

+-- [email protected] 
| +-- @types/[email protected] 
| +-- @types/[email protected] 
| +-- [email protected] 
| +-- [email protected] 
| | `-- [email protected] 
| +-- [email protected] 
| | +-- [email protected] 
| | +-- [email protected] 
| | `-- [email protected] 
| +-- [email protected] 
| +-- [email protected] 
| +-- [email protected] 
| | `-- [email protected] 
| | `-- [email protected] 
| |  `-- [email protected] 
| +-- [email protected] 
| | +-- [email protected] 
| | +-- [email protected] 
| | +-- [email protected] 
| | | +-- [email protected] 
| | | `-- [email protected] 

tsconfig.json

{ 
    "compilerOptions": { 
    "target": "es2015", 
    "module": "es2015", 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "moduleResolution": "node", 
    "sourceMap": true, 
    "allowJs": true 
    }, 
    "awesomeTypescriptLoaderOptions": { 
    "doTypeCheck": true, 
    "forkChecker": true, 
    "useBabel": true, 
    "useCache": true, 
    "babelOptions": { 
     "presets": ["es2015-loose-native-modules"] 
    } 
    }, 
    "exclude": [ 
    "node_modules", 
    "dist", 
    "release", 
    "index.js", 
    "webpack.config.js", 
    "config" 
    ] 
} 

webpack.config.js

"use strict"; 

/** 
* To learn more about how to use Easy Webpack 
* Take a look at the README here: https://github.com/easy-webpack/core 
**/ 
const easyWebpack = require('@easy-webpack/core'); 
const generateConfig = easyWebpack.default; 
const get = easyWebpack.get; 
const path = require('path'); 
const ENV = process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() || 'development'; 
var config; 

// basic configuration: 
const title = 'RPF'; 
const baseUrl = '/'; 
const rootDir = path.resolve(); 
const srcDir = path.resolve('src'); 
const outDir = path.resolve('dist'); 

const coreBundles = { 
    bootstrap: [ 
     'aurelia-bootstrapper-webpack', 
     'aurelia-polyfills', 
     'aurelia-pal', 
     'aurelia-pal-browser', 
     'regenerator-runtime', 
     'bluebird' 
    ], 
    // these will be included in the 'aurelia' bundle (except for the above bootstrap packages) 
    aurelia: [ 
     'aurelia-bootstrapper-webpack', 
     'aurelia-binding', 
     'aurelia-dependency-injection', 
     'aurelia-event-aggregator', 
     'aurelia-framework', 
     'aurelia-history', 
     'aurelia-history-browser', 
     'aurelia-loader', 
     'aurelia-loader-webpack', 
     'aurelia-logging', 
     'aurelia-logging-console', 
     'aurelia-metadata', 
     'aurelia-pal', 
     'aurelia-pal-browser', 
     'aurelia-path', 
     'aurelia-polyfills', 
     'aurelia-route-recognizer', 
     'aurelia-router', 
     'aurelia-task-queue', 
     'aurelia-templating', 
     'aurelia-templating-binding', 
     'aurelia-templating-router', 
     'aurelia-templating-resources', 
    ] 
}; 

const baseConfig = { 
    entry: { 
     'app': [ /* this is filled by the aurelia-webpack-plugin */ ], 
     'aurelia-bootstrap': coreBundles.bootstrap, 
     'aurelia': coreBundles.aurelia.filter(function (pkg) { 
      return coreBundles.bootstrap.indexOf(pkg) === -1 
     }) 
    }, 
    output: { 
     path: outDir 
    } 
}; 

// advanced configuration: 
switch (ENV) { 
    case 'production': 
     config = generateConfig(
      baseConfig, 

      require('@easy-webpack/config-env-production') 
      ({ compress: true }), 

      require('@easy-webpack/config-aurelia') 
      ({ root: rootDir, src: srcDir, title: title, baseUrl: baseUrl }), 

      require('@easy-webpack/config-tslint') 
      ({ emitErrors: true, failOnHint: true }), 
      require('@easy-webpack/config-typescript')(), 
      require('@easy-webpack/config-html')(), 

      require('@easy-webpack/config-css') 
      ({ filename: 'styles.css', allChunks: true, sourceMap: false }), 

      require('@easy-webpack/config-fonts-and-images')(), 
      require('@easy-webpack/config-global-bluebird')(), 
      require('@easy-webpack/config-global-jquery')(), 
      require('@easy-webpack/config-global-regenerator')(), 
      require('@easy-webpack/config-generate-index-html') 
      ({ minify: true }), 

      require('@easy-webpack/config-common-chunks-simple') 
      ({ appChunkName: 'app', firstChunk: 'aurelia-bootstrap' }), 

      require('@easy-webpack/config-copy-files') 
      ({ patterns: [ { from: 'favicon.ico', to: 'favicon.ico' } ] }), 

      require('@easy-webpack/config-uglify') 
      ({ debug: false }) 
     ); 
     break; 
... // test/dev configs 

我知道有一個編譯器選項來禁用無法訪問的代碼,但我寧願不在全局禁用它,而只是在node_modules中的東西。

+0

你不應該在所有的編譯node_modules我覺得 –

+0

@SimonMeskens的骨架是如何設置的一些副作用?我仍然對TS非常陌生,儘管它位於我的排除陣列中... – xenoterracide

回答

1

「allowJs」:真

我解決它通過發送pull請求https://github.com/Semantic-Org/Semantic-UI/pull/4225

,關掉allowJs(我有快1天做遷移做法:https://www.youtube.com/watch?v=gmKXXI_ck7w)。初學者應該可以在一週內完成。這很值得。

您也可以嘗試excludenode_moduleshttps://basarat.gitbooks.io/typescript/content/docs/project/files.html

+0

我已經排除了我的tsconfig – xenoterracide

+0

中的node_modules,值得說設置allowJs爲false可行,但不知道爲什麼我的排除不。 – xenoterracide