Skip to content

Сompilation error on azure websites & kudu #11613

Closed
@sergey-borisov

Description

@sergey-borisov

Hi!

Sorry for the bad english.

I have a project compilation error (TS5009: Cannot find the common subdirectory path for the input files) when deploying in Azure WebSites with CI. On the local machine everything works fine.
TypeScript Version: 2.0.3

The problem is that part of the source files NodeSystem.realpath provides remote path to source file in format //host/volume2-default/.../.../wwwroot/app/file.ts and for the other part of source files getting the local path D:/home/site/wwwroot/app/file2.ts

If remove the parameter outDir in tsconfig.json, I get an error "duplicate identifier 'export = server'" in node_modules/@types/socket.io/index.d.ts, because the compiler duplicates the way to d.ts file:
//host/volume2-default/.../.../wwwroot/node_modules/@types/socket.io/index.d.ts
and
node_modules/@types/socket.io/index.d.ts

There is another solution to the problem?

I changed the method "System.realpath" and compile without error.

Original method: https://github.com/Microsoft/TypeScript/blob/a6443e3e5a722bf7eb48b8b1f5c87b13efbc70c4/src/compiler/sys.ts#L558

realpath(path: string): string {
                    return _fs.realpathSync(path);
                }

My version:

realpath(path: string): string {
                    return path;
                }

tsconfig.json:

{
  "compilerOptions": {
    "allowJs": false,
    "allowSyntheticDefaultImports": false,
    "allowUnreachableCode": false,
    "allowUnusedLabels": true,
    "charset": "utf8",
    "declaration": true,
    "diagnostics": false,
    "emitBOM": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true,
    "isolatedModules": false,
    "lib": ["es6"],
    "locale": "en-us",
    "listEmittedFiles": false,
    "listFiles": false,
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmit": false,
    "noEmitHelpers": false,
    "noEmitOnError": false,
    "noFallthroughCasesInSwitch": false,
    "noImplicitAny": false,
    "noImplicitReturns": true,
    "noImplicitUseStrict": false,
    "noLib": false,
    "noResolve": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "outDir": "bin",
    "preserveConstEnums": false,
    "pretty": true,
    "removeComments": true,
    "skipDefaultLibCheck": false,
    "sourceMap": true,
    "stripInternal": true,
    "suppressExcessPropertyErrors": false,
    "suppressImplicitAnyIndexErrors": true,
    "target": "ES6"
  },
  "include": [
    "**/*.ts",
    "typings/**/*.d.ts"
  ]
}

package.json:

{
 "scripts": {
    "postinstall": "npm run tsc",
    "start": "node server.js",
    "tsc": "node node_modules/typescript/bin/tsc"
  },
  "engines": {
    "node": "~6.3.0"
  },
  "dependencies": {
    "@types/node": "^6.0.41",
    "@types/request": "0.0.31",
    "@types/socket.io": "^1.4.27",
    "request": "^2.75.0",
    "socket.io": "^1.4.8",
    "typescript": "^2.0.3"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions