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

TS5055 with javascript nodejs project #1356

Closed
alanpurple opened this issue Oct 19, 2016 · 12 comments
Closed

TS5055 with javascript nodejs project #1356

alanpurple opened this issue Oct 19, 2016 · 12 comments
Assignees
Labels

Comments

@alanpurple
Copy link

alanpurple commented Oct 19, 2016

Win 10 x64
VS 2015 update3
node.js 6.9.0 x64
ntvs dev 2016. 10.14

TS5055 errors are ocurring with javascript nodejs project

Severity Code Description Project File Line Suppression State
Error TS5055 Cannot write file 'C:/vsworkspace/AdvisorDemo/AdvisorDemoBackend/routes/item-route.js' because it would overwrite input file. TypeScript/JavaScript Virtual Projects 1 Active

@mjbvz
Copy link
Contributor

mjbvz commented Oct 19, 2016

This sounds like a TypeScript issue, similar perhaps to microsoft/TypeScript#8837.

Can you please go to Help -> About Microsoft Visual Studio and also share which version of TypeScript you have installed. Also did you only start seeing this after installing the dev build, or did you see it in the 1.2 release as well?

Thanks.

@alanpurple
Copy link
Author

alanpurple commented Oct 20, 2016

@mjbvz yep, same with ntvs 1.2

@mjbvz
Copy link
Contributor

mjbvz commented Oct 20, 2016

@alanpurple Thanks. To help with the investigation, can you also please provide:

  • Typescript Version. You can find this in Help -> About Microsoft Visual Studio
  • Repo steps. Does this happen on every file save or only sometimes? Does it happen consistently?
  • Does this happen for every js file or just some?
  • Does this happen in a new NTVS project? Trying quickly creating a new express app from the template to check.

Thanks.

@alanpurple
Copy link
Author

alanpurple commented Oct 21, 2016

@mjbvz

  • 2.0.3
  • without saving, just happens after a few seconds I open the project
  • for some js files
  • existing ntvs project, my ntvs project is included in a solution, which also include ASP.NET core project

no errors with newly created ntvs project with express 4.14.0

@alanpurple
Copy link
Author

@mjbvz
It happens when I modify any js file

This is because ntvs project is also configured as typescript virtual project, and somehow, it treats every js files as they are typescript files ( and maybe compileOnSave: true by default )

I think this is not a typescript library problem

@billti
Copy link
Member

billti commented Nov 15, 2016

I believe our recent change at https://github.com/Microsoft/TypeScript/pull/12118/files should fix this. Will verify...

@alanpurple
Copy link
Author

@billti I can't wait to install that with "TypeScript for Visual Studio 2015"

@billti billti added bug and removed need-more-info labels Nov 16, 2016
@billti
Copy link
Member

billti commented Nov 16, 2016

Actually, I just realized that change will only apply to VS Code and VS 2017 (which use tsserver.js from TypeScript). We'll need some changes on the VS side for VS 2015. I'll need to look into this.

For now, if you drop a tsconfig.json in the root of your project which looks like the below (assuming you only have JavaScript files and not TypeScript files), that should resolve it.

{
  "compilerOptions": {
    "module": "commonjs",
    "allowJs": true,
    "noEmit": true,
    "target": "es6"
  },
  "typingOptions": {
    "enableAutoDiscovery": true
  }
}

@billti billti self-assigned this Nov 16, 2016
@alanpurple
Copy link
Author

@billti I have ASP.NET project and nodejs project in one solution. When I make tsconfig.json you told, an error came from node_modules/rxjs file, they can't find modules which exist

@billti
Copy link
Member

billti commented Dec 1, 2016

I'll need to understand the project structure a little better to understand what might be causing this, if you're mixing project types in a solution. Is there any cross referencing? Did the RxJs error come from the ASP.NET or NTVS project? Where/which project did you put the tsconfig.json file in? etc.

If you are able to attach (or email) me some code to repro the problem, that would be really helpful. Is that possible?

@alanpurple
Copy link
Author

@billti sure, I'll email you

anyway this doesn't show anymore in VS2017 RC. no error after modify js file in ntvs project.

@paulvanbrenk
Copy link
Contributor

Closing as this appears to be fixed

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

No branches or pull requests

4 participants