activist
activist copied to clipboard
Prevent TypeScript warnings from "$t" state variable.
Terms
- [X] I have searched all open bug reports
- [X] I agree to follow activist's Code of Conduct
Behavior
In VS Code, in the 'Problems' panel, there are numerous warnings along the lines of: "Property '$t' does not exist on type ...". It looks like these warnings are related to the i18n functionality.
There is no negative performance impact from these warnings, but the cause of these warnings should be resolved, so that the warnings stop appearing.
Closed the PR associated with this issue and self-removed.
Initial solution of this problem made the situation worse.
It looks like the problem originates from local VS Code settings, and not the codebase. We continue to investigate.
Just checking, @mattburnett-repo, you're using the solution that's detailed in localization to get rid of the warnings, right?
Yes, @andrewtavis. I'm using 'vue-i18n.d.ts' as described in the link you provided.
@mattburnett-repo to continue the conversation from the e2e PR where you said the troubleshooting steps didn't work. The root cause of all of this is shared dependencies between the container environment and local environment by mounting the frontend directory in the container.
This means that those troubleshooting steps are not a permanent fix. It's very easy to re-create this bug every time you run a local command after using the frontend container or vice-versa, and then you have to run the troubleshooting steps again each time it breaks. (except you might be able to skip yarn cache clean)
The short term fix could be shadowing the .nuxt and node_modules directories with their own mounts as described in stack overflow.
I also mentioned it on the run yarn locally issue: https://github.com/activist-org/activist/issues/1021#issuecomment-2518823534
Also you may have to restart vscode after the troubleshooting steps for vscode to pick of the fixed typescript imports from nuxt
I also suspect this bug can be caused if you ever accidentally run yarn install in the activist directory. I've done that to myself a couple times.
Maybe we can add a quick note that people e should look out for yarn being installed in the root directory and also telling people to restart VS Code?
Yeah, adding that to the docs is a good idea
Checking in here really quick, @mattburnett-repo: This is still an issue for you, right?
Not really an issue since I started using the 'types/vue-i18n.d.ts' , @andrewtavis. PR 1025, I think.
As a reminder, it's gitignored so it won't show up in the main branch.
But removing it you'd still have the issue? I guess it would make sense to just leave this open in case someone else is facing this as it's more likely that someone checks open issues?
To check this I commented out the body of the d.ts file. The issue returned immediately.
This happened in a different IDE than before.
Agreed to leave this issue open.
Is there a 'troubleshooting' or 'known problems' page/file in the docs that we could write this issue into?
I think the combination of this issue and the community on Matrix would be enough to address the issue if it does happen to someone else :) There's no section just now, but if we do come across other things like this then maybe we can make one and add this in 😊