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.

An internal heuristic needs to be updated

See original GitHub issue

Description

Vite-plugin-ssr uses an internal heuristic to detect whether you are using React.

This heuristic may change over time.

If you run into the warning [vite-plugin-ssr][Warning] An internal heuristic needs to be updated then help us update the heuristic by doing the following:

  1. Update vite-plugin-ssr to its latest version ($ npm info vite-plugin-ssr).
  2. Edit node_modules/vite-plugin-ssr/dist/esm/utils/detectHydrationSkipSupport.js and add a new line:
    console.log(`isReact1: ${isReact1}, isReact2: ${isReact2}, isReact3: ${isReact3}`);
    
    Just before this line:
    assertWarning(condition, 'An internal heuristic needs to be updated...');
    
  3. rm -rf node_modules/.vite/ then start your server and let us know the output of the console.log() you just added.
  4. What UI framework are you using? Which version? If you use React:
    • $ cat node_modules/react/package.json | grep version
    • $ cat node_modules/@vitejs/plugin-react/package.json | grep version

FYI, this heuristic is only used to set the right default boolean value of an option. This heuristic is not crucial and can be removed. (Removing it would only induce a slight DX inconvenience as the user would have to manually set the option’s value).

Error Stack

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ArthurSaenzcommented, Nov 2, 2022

isReact1: true, isReact2: false, isReact3: false

1reaction
brilloutcommented, Aug 29, 2022

Updated heuristic released in v0.4.28. I didn’t test the change but I believe it should work. Let me know if you still get the warning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Usability Heuristics for User Interface Design
The design should speak the users' language. Use words, phrases, and concepts familiar to the user, rather than internal jargon.
Read more >
Lecture 4: Optimal and Heuristic Search - ICS, UCI
An A* guided by consistent heuristic finds an optimal paths to all expanded nodes, namely g(n) = g*(n) for any expanded n. –...
Read more >
Heuristics - Stanford CS Theory
A heuristic that has the exact distance is ideal for making A* fast but it's usually impractical. We can often preprocess the graph...
Read more >
Heuristic Estimate - an overview | ScienceDirect Topics
First, Hierarchical A* calculates the heuristics on demand. ... on that of its successors, it has to be updated whenever the latter ones'...
Read more >
A* with reopening when heuristics is only admissible but not ...
All other nodes still in OPEN must have at least as large of an f -score, and due to the assumption of admissible...
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