-
Notifications
You must be signed in to change notification settings - Fork 1.9k
TypeScript can't find Shiny
in @types/rstudio-shiny
#4197
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
Comments
Adding import type { ShinyClass } from "../src/shiny/index";
declare global {
const Shiny: ShinyClass;
interface Window {
Shiny: ShinyClass;
}
} I wonder if it's because there's some configuration difference in the tsconfig between this repo and py-shiny, where py-shiny doesn't know that @schloerke Do you remember if there was some specific reason not to include |
Now that I think back on it, I think maybe we were moving toward using For example: shiny/srcts/src/shiny/index.ts Lines 691 to 699 in f55c26a
That's fine by me -- it's more explicit where We also talk about using |
Uh oh!
There was an error while loading. Please reload this page.
In py-shiny, I locally updated package.json so that instead of pointing to the
v1.8.0
tag, it pointed to the types from this repo'sv1.1.10
tag:After I did that, TypeScript was no longer able to find the
Shiny
object:The problem likely has to do with the globalShiny.d.ts file. This is the 1.10.0 version:
This is the 1.8.0 version:
Interestingly, TypeScript is able to see it via
window.Shiny
:The text was updated successfully, but these errors were encountered: