-
Notifications
You must be signed in to change notification settings - Fork 31
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
Quokka does not respect tsconfig "paths" option #14
Comments
Could you please create a sample demonstrating the issue, we're happy to have a look. |
Same here. I use Looks like Quokka does not use the |
@Knaackee Please create a sample demonstrating the issue. I have created this basic sample with decorators and it's working as expected both in quokka file and in the project's module. |
Hey @ArtemGovorov. Here's an example repo showing my particular problem: https://github.com/lemonmade/quokka-paths-example. If you try to create a new TypeScript file with quokka and write, for instance: import myPackage from 'my-package';
import app from 'app'; Neither of those imports is able to resolve, despite the fact that the Let me know if I can provide any more details or if I made any obvious mistakes. |
@lemonmade Thanks for the sample. TypeScript doesn't do any changes to the paths in the code, so when node runs the code it can't find the modules, and it makes sense. I have done a bit of research, and it looks like I have added the note to our docs: if you are using paths in your Note that you'll also need to update to the latest v1.0.11 of the extension to make it work. |
Thanks for looking into this! We're you able to get my example repo working with that setup? I updated my version of the extension and installed the latest versions of both packages but still no dice. Is there a particular quokka config that's needed in order to use that version of TS-node and the require hook? |
Yes, I was able to get your example to work. All I did was what I have mentioned:
(you may do it in the project or in the quokka global folder) |
Nope, just the mentioned node modules. If it doesn't work for you, please paste the error you're getting from quokka console. |
Ah, thanks @ArtemGovorov. I expected that since it was showing errors, it was not working, but you are right that everything resolves correctly. It is unfortunate that it shows errors for the import path/ decorators/ doesn't allow command-click-to-definition like it would in a normal project file, though. |
@lemonmade It's because there's no physical file, so VS Code doesn't seem to be willing to apply the |
Is there any example where extended tsconfig used? // root tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@first/*": ["shared/*"]
}
}
} -Packages // tsconfig.json inside SubProject
{
"extends": "../tsconfig.json",
"include": ["."],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@second/*": ["../shared/*"]
}
}
} It will Pass on indexRoot but Im sure 99% there is example for that but due repo names you are making like quokka/wallaby-1234 it is not possible to find. So ether it is a bug ether my fail in configuration, I have no ideas and working example needed. |
@dadiborn - currently Quokka runs your TypeScript files from your project root, and this is by design. So if have a project open that has sub-packages, the I have created a feature request to support your scenario. We will likely get a chance to review viability of implementing the feature and consider scheduling in the next week or two. |
Thank you for reply, If I have missed that information in docs, that was fun hours of searching for solution :) if not please add a note about this limitation into documentation. Thank you |
Issue description or question
Loving Quokka so far. I expected that I would be able to import from within my project and it works great overall, except that it does not seem to pick up my
paths
option intsconfig.json
that I use to rewrite some import paths to a custompackages
directory inside of my project. I tried a variety of setups (with and withoutts-node
installed, with and without a customquokka
config in my rootpackage.json
that duplicated mytsconfig.json
), but couldn't seem to get that path resolution to work.Code editor version
Visual Studio Code v1.10.2
OS name and version
macOS 10.12.3
The text was updated successfully, but these errors were encountered: