Closed dkoprowski closed 3 years ago
@secondfry @amatiasq Hi, I downloaded the newest extension version but the issue is still here.
Maybe my config is wrong somehow?
How can I help you track this down?
4/15/2021, 3:03:42 PM:
----------------------
Cannot find module 'import-sort-style-module-alias-x'
Require stack:
- /Users/danielkoprowski/.vscode/extensions/amatiasq.sort-imports-6.2.5/out/config-cache.js
- /Users/danielkoprowski/.vscode/extensions/amatiasq.sort-imports-6.2.5/out/sort.js
- /Users/danielkoprowski/.vscode/extensions/amatiasq.sort-imports-6.2.5/out/extension.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js
@dkoprowski I've had issues with caching, try closing all VScode instances and reopen them.
@secondfry I tried to restart VSCode, restart Mac, uninstall extension & install again. No success :(
It's strange that it says Cannot find module 'import-sort-style-module-alias-x'
while I have "style": "module-alias",
setting. (Notice -x
postfix).
I also have in my packages json those dependencies:
"import-sort-parser-typescript": "^6.0.0",
"import-sort-style": "^6.0.0",
"import-sort-style-module-alias": "^1.1.0",
Maybe there is some collision?
@dkoprowski AFAIK extension ignores your package.json
setting (may be wrong here, not a maintainer). Check your settings in VScode, feels like you have style with -x
there.
Ok, I managed to solve it. For some reason, I had module-alias-x
in extension settings. Maybe it's from my settings sync extension.
Looks like package.json
isn't ignored. In the docs they say:
sort-imports.default-sort-style: sorting style if package.json doesn't have import-sort key (default: eslint).
I tested it and when changing style to eslint
sorting changes.
So it takes settings from package.json
but if something is wrong in extension settings it doesn't work.
The ticket is solved, thanks for the help!
Hi, I have a fresh install of my project on a new machine and suddenly import-sort stopped working. In the output log I see this:
This is my
importSort
inpackage.json
.Everything is freshly installed. Strange that it doesn't work out-of-the-box. Do you have any ideas?
VS Code extension
And packages:
CLI
It works well from CLI:
It worked well so it seems like a bug in the extension.
Previously I've created an issue in "import-sort-style-module-alias" repo.
https://github.com/fsmaia/import-sort-style-module-alias/issues/9#