tide icon indicating copy to clipboard operation
tide copied to clipboard

Resolving project files does not work anymore

Open jvalkeejarvi opened this issue 5 years ago • 10 comments

Relevant Version Numbers

  • Tide: 20190614.1227
  • TypeScript: 3.2.4
  • Emacs: 26.2

Steps to Reproduce the Bug

  • create file html.d.ts with following content:
declare module '*.html';
  • don't import file anywhere in the project but make sure it gets included in project build by configuring tsconfig.json
  • import any .html file somewhere in project

Expected Behavior

Importing .html file works

Actual Behavior

Error Cannot find module './file-name.html'. [2307]

After opening file html.d.ts with Emacs errors are gone.

Importing .html files worked fine before upgrading tide. Could it be that upgrading tsserver broke something?

Also I have a similar problem with namespaces from some node_modules package. I get error first but after opening my Angular projects app.module.ts file (which imports practically everything else) namespace related errors are gone.

jvalkeejarvi avatar Jun 17 '19 06:06 jvalkeejarvi

do you have typescript installed locally? Could you check what's the tsserver version with tide-verify-setup and see if downgrading typescript version solves the issue.

ananthakumaran avatar Jun 17 '19 08:06 ananthakumaran

Yes I have project local typescript installation. tide-verify-setup says that tsserver version is 3.2.4.

I noticed that tide-rename-symbol fails with following error :

Error: No Project.
    at Object.ThrowNoProject (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:119996:23)
    at IOSession.Session.getProjects (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:125084:42)
    at IOSession.Session.getRenameLocations (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:125101:37)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:124288:61)
    at /home/juuso/git/project/node_modules/typescript/lib/tsserver.js:125836:88
    at IOSession.Session.executeWithRequestId (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:125827:28)
    at IOSession.Session.executeCommand (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:125836:33)
    at IOSession.Session.onMessage (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:125858:35)
    at Interface.<anonymous> (/home/juuso/git/project/node_modules/typescript/lib/tsserver.js:127118:27)
    at Interface.emit (events.js:198:13)
    at Interface._onLine (readline.js:308:10)
    at Interface._normalWrite (readline.js:451:12)
    at Socket.ondata (readline.js:165:10)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Could these be related or should I open another issue?

jvalkeejarvi avatar Jun 17 '19 13:06 jvalkeejarvi

could you share the output of M-x tide-verify-setup? These kinds of error usually means some issue at tsserver.

ananthakumaran avatar Jun 17 '19 13:06 ananthakumaran

tsserver version: 3.2.4

config file path: /home/juuso/git/enerkey2/front/tsconfig.json

Thanks a lot for quick response. I just realized that I have tsconfig.app.json which probably should be used instead.

jvalkeejarvi avatar Jun 17 '19 13:06 jvalkeejarvi

is this an angular project?. This has come up before, but we don't have a good solution for this right now. tide can only support tsconfig.json. None of the other files are considered, so it's not going to work properly if tsconfig.json file is incomplete

ananthakumaran avatar Jun 17 '19 13:06 ananthakumaran

Angular project, yes. This is a little weird because last week everything worked fine and I have not updated anything in my project.

jvalkeejarvi avatar Jun 17 '19 13:06 jvalkeejarvi

Do you know what's the old tide version? is it possible to rollback and confirm the issue is with tide?

ananthakumaran avatar Jun 17 '19 13:06 ananthakumaran

Unfortunately I don't remember the old version. Probably two weeks old at most. Should I just install some older version manually?

jvalkeejarvi avatar Jun 17 '19 13:06 jvalkeejarvi

I don't know of any version of tide that was able to use tsconfig.app.json automatically. See https://github.com/ananthakumaran/tide/issues/242#issuecomment-408995380 Point 2 in particular is extremely problematic.

lddubeau avatar Jun 17 '19 13:06 lddubeau

Unfortunately I don't remember the old version. Probably two weeks old at most. Should I just install some older version manually?

melpa might not work, you would have to probably clone the repo and checkout old version

ananthakumaran avatar Jun 17 '19 13:06 ananthakumaran