question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-cache alphas don't work with 16.8+

See original GitHub issue

react-cache was not published with 16.8.1 like the rest of the react packages. This means that the platform’s Suspense stuff will not work.

_Originally posted by @jaredpalmer in https://github.com/palmerhq/the-platform/pull/70#issuecomment-461170282_

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
andykaiscommented, Mar 28, 2019

The current solution is indeed building from source, but if people want to streamline the process, you can try adding this to your package.json:

  "scripts": {
    "postinstall": "git clone git@github.com:facebook/react.git --depth=1 && cd react && yarn install --frozen-lockfile && npm run build react-cache && cd .. && npm i $(npm pack ./react/build/node_modules/react-cache) && rm -rf react react-cache-*.tgz"
  },

credit goes to this stackoverflow answer

It would be awesome if react took advantage of the npm’s “prepare” script and npm allowed installing from directories in git repos, but thats not likely going to change any time soon. For now, this solution is fine

1reaction
gaearoncommented, Mar 7, 2019

If you want to experiment you should be able to build from source. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

React 16.x Roadmap – React Blog
Note that React Cache itself isn't strictly tied to React releases, but the current alphas lack basic features as cache invalidation, and you' ......
Read more >
дэн on Twitter: "Heads up: react@16.8.0-alpha.0 and react ...
react -cache (which we shouldn't be using, we know) also needs a release. 2.0.0-alpha.1 does not work anymore because of the "owner/dispatcher" ...
Read more >
Cache Busting a React App - DEV Community ‍ ‍
Invalidate cache and hard reload the app when there's a version mismatch. Note: The examples and explanations in this post are React based....
Read more >
展望react-cache,一个React 官方的处理数据副作用方案- 掘金
相信做过React 代码分割的同学基本上对Suspense 都… ... 'readContext' of undefined #14575 · react-cache alphas don't work with 16.8+ #14780 ...
Read more >
React 16.x 蓝图[双语版] - CodeAntenna
Don't forget to update react-dom — otherwise Hooks won't work. ... 注意React Cache 自身并不严格依赖于React 版本, 而且当前的alphas 版本缺少基础特性, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found