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

(fix) auto import in workspace without tsconfig/jsconfig #1543

Merged
merged 7 commits into from Jul 19, 2022

Conversation

jasonlyu123
Copy link
Member

@jasonlyu123 jasonlyu123 commented Jul 1, 2022

#1175. Not 100% sure it's the problem but the error is the same. It also happens in the rollup template that what I get the reproduction.

This one is very tricky to write a test for. So I use a virtual system to write an isolated test. It only happens because of some declaration files that are referenced by the /// <reference type=""> triple-slash directives. And it needs the node_modules to be at the root of the workspace.

What happens is that typescript resolved a module by a relative path to node_module. And try to resolve the absolute path to the module so it can proceed with the auto import. But the provided currentDirectory is an empty string. I changed it to use the target file path to find the nearest workspace root. So we would always have a current directory.

@dummdidumm
Copy link
Member

dummdidumm commented Jul 1, 2022

Did you link the wrong issue? The issue you link to is about emmet completions, not sure how this is related to them - do you mean that message in the stack trace?

@jasonlyu123
Copy link
Member Author

jasonlyu123 commented Jul 1, 2022

Yeah, I mean the error. I guess sometimes it triggers an auto import and errors out. Maybe it's just a coincidence that it happens in his attempts. Let's treat it as unrelated then. But we could ask him if it improves.

@dummdidumm dummdidumm merged commit adf82ab into sveltejs:master Jul 19, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants