Typescript doesn't recognize properties on `this` in standalone ts file
See original GitHub issueReproduction
We’re working on a stand-alone lib of “common” pinia stores that we can re-use across different front end projects within our team. Kinda like a library of pinias. It’s working, but we seem to be losing type detection on this
when we setup pinia in a stand alone project. I’ve attached an example of how we have things setup.
Steps to reproduce the behavior
- Open
shared-stores
example project attached - go to
cool-store.ts
- See error
Expected behavior
properties added to state
would be recognized when accessing this
in actions
or getters
Actual behavior
these properties are not recognized
Additional information
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Typescript type error standalone script. · Issue #2175 - GitHub
I decided to run standalone Typescript script via ts-node, problem is simple: I use property "ethers" from "hre" and it exists and works,...
Read more >ts is missing from the TypeScript compilation. Please make ...
In my case (i'm using Angular), i just set typescript related path into tsconfig.app.json (ATTENTION: file name is not tsconfig.json ) ...
Read more >TypeScript: JavaScript With Syntax For Types.
TypeScript is JavaScript with syntax for types. TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at ......
Read more >TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >TypeScript configuration - Angular
When the compiler doesn't recognize something, it reports an error. Use TypeScript type definition files — d.ts files — to tell the compiler...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No worries, remember there is a Discord chat to ask quick questions! You can also use <kbd>cmd + shift + p</kbd> and search for restart ts
Thanks for the quick response @posva and the amazing work on this lib!
We’ll jump in the discord chat first if we hit other snags. @kruebling and I are working on a mono-repo setup for multiple vue 3 apps, which is also our first big jump into typescript. Maybe we’ll write a blog if it works out 😄