Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work, false possitive #4

Closed
Bielik20 opened this issue Mar 9, 2018 · 3 comments
Closed

Doesn't work, false possitive #4

Bielik20 opened this issue Mar 9, 2018 · 3 comments

Comments

@Bielik20
Copy link

Bielik20 commented Mar 9, 2018

Hello, I was trying to use it on simple test project. My structure is:

  • server
  • libs
    • models
  • tsconfig.json

tsconfig.json looks like that:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./dist",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "./dist",
    "sourceMap": true,
    "target": "es6",
    "typeRoots": [
      "node_modules/@types"
    ],
    "baseUrl": ".",
    "paths": {
      "~/*": ["libs/*"]
    }
  }
}

After executing tspath I get this message:

Total files processed: 5
Total paths processed: 2
Operation finished in: 22.956ms
Project is prepared, now run it normally!

However paths were not replaced. Files were altered but paths remain the same. What do I do wrong?

@duffman
Copy link
Owner

duffman commented Mar 9, 2018 via email

@Bielik20
Copy link
Author

Bielik20 commented Mar 9, 2018

Sure, here it is:

server/app.ts

import { json, urlencoded } from 'body-parser';
import * as compression from 'compression';
import * as express from 'express';
import * as path from 'path';
import { Foo } from '~/models';

const app: express.Application = express();

app.disable('x-powered-by');

app.use(json());
app.use(compression());
app.use(urlencoded({ extended: true }));

const foo = new Foo();


console.log('App is working ' + foo.name);

export { app };

On a side note ts-node with tsconfig-paths installed works perfectly.

@Bielik20
Copy link
Author

Hello, I have managed to find what the issue was. I was using "node": "9.7.1", not the lts version. It appears that it doesn't work under version 9.x.x. When I installed version 8.10.0 everything works as expected. I think this issue can be closed and perhaps we could open one about node version 9.x.x.

Anyway, thank you for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants