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

Prevent TypeScript warnings from "$t" state variable. #1025

Open
2 tasks done
mattburnett-repo opened this issue Nov 30, 2024 · 8 comments
Open
2 tasks done

Prevent TypeScript warnings from "$t" state variable. #1025

mattburnett-repo opened this issue Nov 30, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@mattburnett-repo
Copy link
Collaborator

mattburnett-repo commented Nov 30, 2024

Terms

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.

@mattburnett-repo mattburnett-repo added the bug Something isn't working label Nov 30, 2024
@mattburnett-repo mattburnett-repo self-assigned this Nov 30, 2024
@mattburnett-repo mattburnett-repo removed their assignment Nov 30, 2024
@mattburnett-repo
Copy link
Collaborator Author

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.

@andrewtavis
Copy link
Member

Just checking, @mattburnett-repo, you're using the solution that's detailed in localization to get rid of the warnings, right?

@mattburnett-repo
Copy link
Collaborator Author

Yes, @andrewtavis. I'm using 'vue-i18n.d.ts' as described in the link you provided.

@cquinn540
Copy link
Collaborator

@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: #1021 (comment)

@cquinn540
Copy link
Collaborator

Also you may have to restart vscode after the troubleshooting steps for vscode to pick of the fixed typescript imports from nuxt

@cquinn540
Copy link
Collaborator

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.

@andrewtavis
Copy link
Member

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?

@cquinn540
Copy link
Collaborator

Yeah, adding that to the docs is a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants