-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Getting Cannot find module 'dsl/message'
error in 10.2.0
#974
Comments
Gah! I really need to find a way to prevent my editor from using aliased imports, and investigate if this can be easily added to our CI to fail a build. I'll get a patch out ASAP. (also, thank you for the kind words) |
Thanks for the quick fix! |
You're welcome |
Some IDEs (such as VS Code) are aware of the `baseUrl' property, and will auto-complete imports using the base URL as a prefix in the import, instead of a relative URL. This creates problems for consumers of the library, as the path is no longer relative to the top level project base (I think). Even if this is untrue, it's best to stick with a single, consistent approach. As an example, see a20ad80 which had to correct one such problem. See also #974
The problem is that if you're using aliases or a baseurl typescript doesn't convert the import paths on compilation, and as far as I know you can't make it convert them (unless you compile with something like babel or webpack as a post processing step)
I don't remember which editor you use, but in VS Code this is under TypeScript › Preferences: Import Module Specifier. Not using |
I guess this isn't picked up at test time because ts-jest just runs the typescript :/ |
Ah yes, thanks - I've made that change now.
Removing this makes it a compilation error, which I think is what we want (I added that change in yesterday, and found two more imports). Thanks for the tips everyone. |
I read the docs for that option after my comment last night, and it is there in typescript as a convenience for systems that use a different import structure or have a post processing step that moves files around. So we shouldn’t have had it set anyway. Probably my fault, sorry! |
Hi guys, thanks for the great work!
We just upgraded to version 10.2.0 but our
yarn lint
is failing due to 2 import paths:Are aliased import paths typo or intentional?
Software versions
Please provide at least OS and version of pact-js
18
Issue Checklist
Please confirm the following:
Expected behaviour
No linting error
Actual behaviour
Getting the above errors
Steps to reproduce
It can be tested with a fresh install
Relevant log files
See above
The text was updated successfully, but these errors were encountered: