Installing React via documented method doesn't work #782
Comments
Note: I found this issue #766 with a similar error message. The issue is marked resolved, but the issue was never resolved. The user worked around it by switching from using Is it possible to get react typings through typings? |
No, it's not. There's nothing we can do from Typings, unfortunately. See #738. |
It doesn't.
Yes, you really should learn the difference. It's not my fault DefinitelyTyped was always jank - I avoid breaking things from DefinitelyTyped but TypeScript wasn't afraid to pull that plug since it was needed for TypeScript 2.0 to evolve.
I thought it was explained enough, but feel free to submit a PR. I'm no longer actively working on Typings since TypeScript has effectively EOL'd it with NPM
You don't. These changes were not from us, and any application previously using Typings would still be working since everything is pinned to commit tags. TSD has been deprecated for over a year now, and even it would keep working along. Your problem is you expect DefinitelyTyped not to have changed, not the package managers. And, in fact, I've been very explicit that I don't control DefinitelyTyped and this would occur one day - every namespace under Typings is still the same. |
"There's nothing we can do from Typings, unfortunately " No, hold on, I don't believe you. What happened to the package which tsd would have installed six months ago? Was it deleted? Is it in github somewhere? |
And even if there's nothing you can do to make it work, you could at least remove from your README/documentation sample lines which no longer work. |
It is still there, you would need to find the last commit hash where it was working. You can find this through the Typings CLI (http://api.typings.org/entries/dt/react/versions?deprecated=true). However, that doesn't mean we can fix this situation. It just means you can use old stuff. |
@xmcclure Feel free to submit a PR - maybe I wasn't clear on my maintenance of the module. I'm just waiting for microsoft/types-publisher#4 to deprecate officially - something I hoped to do six months ago. Hopefully it'll be soon, but I'm happy to update the docs to reflect the current state. |
"you can find this throuhg the Typings CLI… It just means you can use old stuff." Thank you for the help, I think this url is what I was looking for… getting my existing "old stuff" to work is all I was trying to do _ |
If anyone runs across this for future reference: Using the api.typings.org link above I was able to get circa-last-year versions of DefinitelyTyped typings of react-global, react-dom, and react. Unfortunately the react-dom package installed this way did not appear to actually export the ReactDOM object, so here I had to give up… |
Again for any future person reading this: My eventual solution was to remove tsd, typing and all my
Despite my previous fears I did not have to switch to using npm to install react itself for this, and I was able to continue using the same version of react I had been using. As long as I upgraded to TypeScript 2 this worked. |
@xmcclure thanks for adding information for future reference. 🌷 |
I have a web application which uses particular versions of React and JQuery. It previously installed these by installing the jquery and react-global packages via tsd. I am now having to very rapidly port this web app to typings because tsd has apparently been shut down ( DefinitelyTyped/tsd#269 (comment) ) and so our previous build process no longer runs.
Your documentation ( https://github.com/typings/typings/blob/master/docs/tsd.md ) specifically suggests running:
This doesn't work. It prints
I don't know what that means. However, say I remove the "--global" option. My build script now looks like:
Your documentation ( https://github.com/typings/typings ) says to "use
typings/index.d.ts
(intsconfig.json
or as a///
reference)." I have existing /// references to tsd.d.ts, which I change to references to index.d.ts.I hit "make". I get 354 errors. Most of them are of the form "Cannot find name 'React'." However, there is also an error in the d.ts file installed by typings:
I don't know what that means. However, if the error is in a file generated by typings, it seems like I can't possibly fix it.
Meanwhile, I am starting to get worried. There is a vague and confusing document ( https://github.com/typings/typings/blob/master/docs/external-modules.md ) linked in your README which seems to be suggesting that if react is not "global", then it is an "external module", and if it is an "external module" that means that I can no longer use /// references and must switch to ES6 style "import"s. This is extremely worrisome. Will I have to actually rewrite my code to use "import"? Does using "import" mean I will have to also use a tool such as webpack? My application does not use webpack, I just include React using <script />.
What I am trying to figure out
<reference />
: Can I somehow get a copy through typings of the old "react-global" package, the versiontsd
would have installed four months ago, the version that did support<reference />
? I am using React 0.14.3. (I triedtypings install dt~react@0.14.0
but this gave me the same non-global, non-functioning package).Expected behaviors:
tsd
should work.typings
invocations listed in the typings documentation should work.typings
should never install an index.d.ts file which produces errors.<reference />
configuration.tsd install bleh
worked a year ago, thentypings install dt~bleh@oldversion
should work today.Configuration
The text was updated successfully, but these errors were encountered: