-
Notifications
You must be signed in to change notification settings - Fork 392
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
CRA2 compatibility #264
Comments
I haven't test it with latest CRA2. I only tested it with alpha versions. So yes something can be broken |
Probably connected to facebook/create-react-app#5309 |
@stereobooster How will this affect react-snap, that they've started to inline chunks? |
They inline first chunk and this is intentional. We need to investigate further what is broken |
It seems that fix is (package.json): "reactSnap": {
"fixWebpackChunksIssue": false
} Please test and tell me if it helps Update Also, try |
@stereobooster Yup sure seems to help! What exactly was the "fix" meant to do, that disabling helps? |
It fixes how webpack chunks are inserted in html in CRA1, it appears they fixed it in CRA2 |
Ah sweet! Thanks for the quick solution @stereobooster. Much appreciated! |
Update: |
Does CRA v2.0.5 fix the issue? i.e by adding env var |
@jasan-s from my quick tests it seems it works |
Now the big question, inline scripts vs extra requests, with react-snap. |
If someone here is looking for the solution, the environment variable is
|
Which is correct? |
@uxitten if you define it in .env file use |
@jasan-s thanks, but |
did you also add this "fixWebpackChunksIssue": false
|
See this issue for TimeOut #240 |
I finally got to this issue. Try this in "react-snap": "https://github.com/stereobooster/react-snap.git#crav2", Run |
x# Please enter the commit message for your changes. Lines starting
x# Please enter the commit message for your changes. Lines starting
Released fix in v1.22.0 |
This throws if you have no devDeps.
Fixed in #312 |
Is anyone still experiencing this with Client doesn't: // src/index.tsx
import React from "react";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import { hydrate, render } from "react-dom";
const rootElement = document.getElementById("root");
console.log("hi!!");
if (rootElement && rootElement.hasChildNodes()) {
hydrate(<App />, rootElement);
} else {
console.log("[app] render");
render(<App />, rootElement);
}
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister(); I'm running |
I was just trying out
react-snap
with my project. When I open the site I get a lot of these warnings:The resource http://localhost:8000/static/js/5.f6bab7d8.chunk.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally.
Are chunks not properly supported, or is this something else?
Thanks!
The text was updated successfully, but these errors were encountered: