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
Closed
nearwood opened this issue
Jan 23, 2019
· 13 comments
Closed
[DOCS] Minified React error #185
#3421
nearwood opened this issue
Jan 23, 2019
· 13 comments
Comments
Windows 10 64
FF 64.0.2 (64-bit)
I keep running into into this on the current docs:
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
The full message being:
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
I will attempt to note how to reproduce it later today, as it happens often.
Well, it failed to occur yesterday, but it did just now. I clicked this link https://react-bootstrap.netlify.com/components/forms/#form-row-props
from within the Forms docs.
Got a full stack trace:
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Error: Script terminated by timeout at:
Sn@https://react-bootstrap.netlify.com/2-68b2153cc7f036eae14f.js:1:726504
An@https://react-bootstrap.netlify.com/2-68b2153cc7f036eae14f.js:1:726401
Mn</e.prototype.componentDidUpdate@https://react-bootstrap.netlify.com/2-68b2153cc7f036eae14f.js:1:730550
Aa@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:203493
Na@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:199152
ja@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:198497
Ea@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:197518
Zi@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:196421
enqueueSetState@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:161349
x.prototype.setState@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:80940
M</t.prototype.componentDidMount/t.unlisten</</<@https://react-bootstrap.netlify.com/app-436a48db75de79f1b072.js:1:18652
Also note: This kills the browser.
At least until the FF watchdog intervenes.
@nearwood
«Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.»
Is setState() being called by componentDidUpdate()? Because componentDidUpdate() is called after each state change, this will cause an infinite loop until you run out of stack. This is likely the problem.
do you have a specific page in the docs that triggers this?
@taion It has happened on other pages than the one mentioned in my previous comment. I think it might be isolated to the API links, but can’t confirm definitively.
Yes, but not easily. I clicked around the docs for a while. Then left the Button page open for a while. Came back to it. Edited the example shown, then tried to click the ToggleButtonGroup API link:
Wondering if the inline editor has something to do with it — I rarely use it, but can’t discount it.
FF 65.0.2 (64-bit)
I got the error when I implemented the redux-reset library, click on the logout button, and since the status, I have in redux is something big it sends me that error
We’re going to need a more self-contained repro to do anything here. None of these components are doing much of anything that should cause this.
So above issue was solved with what change?
This issue is pretty stale, and I haven’t run into this, so will close it for now.
Well, maybe this is happening because of how I wrote my code. That happen because I am still learning React and all the stuff that I use in the code yesterday.
I am not yet even implementing a react tracker for the loading ui.
The purpose
I want to make a contact form for a course facilitator, but it is much more complex because I need image, checkbox for the program they choose, etc. At least for me that is complex than my blog.
Things that I have tried
I have tried it in development, it works like a charm.
The build also works seeing no problem.
The page after the build can still be visited.
The warning in Chrome
I get a violation in almost all of it. like in click handler, setTimeout, input handler.
The error that I get is three right after I click anything.
Two of the error start with error, but the last one is uncaught error. Maybe that does not matter?
Disclaimer
I may have used some Indonesian language in my code for name and stuff.
import React, { Component } from 'react';
import axios from 'axios';
import Header from "../components/Header"
import Footer from "../components/Footer"
export default class Daftar extends Component{
constructor(){
super();
this.state={
enable: false,
name:'',
email:'',
telepon:'',
program:'',
tempat_lahir:'',
tanggal_lahir:'',
selectedFile:'',
selectedFile1:'',
}
this.handleInputChange = this.handleInputChange.bind(this);
this.handleInputChange1 = this.handleInputChange1.bind(this);
}
handleChange = event =>{
this.setState({ [event.target.name]:event.target.value });
}
handleInputChange(event) {
this.setState({
selectedFile: event.target.files[0],
})
}
handleInputChange1(event) {
this.setState({
selectedFile1: event.target.files[0],
})
}
onChange(event){
let day_list = this.state.program;
let check = event.target.checked;
let checked_day = event.target.value;
if(check){
this.setState({
program: [...this.state.program, checked_day]
})
}else{
var index = day_list.indexOf(checked_day);
if (index > -1) {
day_list.splice(index, 1);
this.setState({
program: day_list
})
}
}
}
componentDidUpdate( prevState) {
if (
( prevState.email !== this.state.email )||
( prevState.name !== this.state.name )||
( prevState.telepon !== this.state.telepon) ||
prevState.program !== this.state.program
) {
if (this.state.email ||
this.state.name ||
this.state.subject ||
this.state.message
) {
this.setState({ enabled: true });
} else {
this.setState({ enabled: false });
}
}
}
handleSubmit = event =>{
event.preventDefault();
const KK = new FormData()
KK.append('kartu-keluarga', this.state.selectedFile)
console.warn(this.state.selectedFile);
const ijazah = new FormData()
ijazah.append('ijazah', this.state.selectedFile1)
console.warn(this.state.selectedFile1);
let url = `${process.env.GATSBY_DIRECTUS_API_URL}/gemaclc/items/pendaftar?access_token=${process.env.GATSBY_DIRECTUS_TOKEN}`;
let url2 = `${process.env.GATSBY_DIRECTUS_API_URL}/gemaclc/files?access_token=${process.env.GATSBY_DIRECTUS_TOKEN}`;
let id_ijazah;
let id_item;
let id_kk;
axios.post(url, {
status:"published",
nama: this.state.name,
email: this.state.email,
telepon: this.state.telepon,
program_yang_dipilih: this.state.program,
tanggal_lahir: this.state.tanggal_lahir,
tempat_lahir: this.state.tempat_lahir,
})
.then(res => {
console.log(res)
id_item = res.data.data.id;
return axios.post(url2, KK, )
})
.then(res => {
console.log(res)
console.log(res.data.data.id)
id_kk = res.data.data.id;
return axios.post(url2, ijazah, )
})
.then(res => {
console.log(res.data.data.id)
id_ijazah = res.data.data.id;
console.log(id_ijazah)
return axios( `${process.env.GATSBY_DIRECTUS_API_URL}/gemaclc/items/pendaftar/${id_item}?access_token=${process.env.GATSBY_DIRECTUS_TOKEN}`,
{
method:"patch",
data :{
kartu_keluarga: id_kk,
ijazah:id_ijazah
},
})
})
.then(res =>{
console.log(res)
})
.catch(error => {
console.log(error)
});
};
render(){
let form = "daftar-form"
let div = "daftar-div"
let div1 = "daftar-div1"
let label1 = "daftar-label1"
let label2 = "daftar-label2"
let label3 = "daftar-label3"
let checkbox = "daftar-checkbox"
let email = "daftar-email"
let nama = "daftar-nama"
let p1 = "daftar-p1"
let submitDisable = "daftar-submit-disable"
let submit = "daftar-submit"
let programDiv = "daftar-program-div"
return(
<div>
<Header/>
<div className={div}>
<div className={div1}>
<h1>Formulir Pendaftaran </h1>
<form onSubmit={this.handleSubmit} className={ form}>
<label className={label1}>
<span>
<p className={p1}> Nama : </p>
</span>
<input type="username" name="name" onChange={this.handleChange}
className={nama}
/>
</label>
<label className={label2}>
<span>
<p className={p1}> Email : </p>
</span>
<input type="email" name="email" onChange={this.handleChange}
className={email}
placeholder="name@location.com"/>
</label>
<label className={label3}>
<span>
<p className={p1}> telepon : </p>
</span>
<input type="tel" name="telepon" onChange={this.handleChange} className={nama}
/>
</label>
<label className={label3}>
<span>
<p className={p1}> Tempat Lahir : </p>
</span>
<input type="text" name="tempat_lahir" onChange={this.handleChange} className={nama}
/>
</label>
<label className={label3}>
<span>
<p className={p1}> Tanggal Lahir : </p>
</span>
<input type="date" name="tanggal_lahir" onChange={this.handleChange} className={nama}
/>
</label>
<div className={programDiv}>
<h3>Program yang Di pilih :</h3>
<label >
<input type="checkbox" onChange={this.onChange.bind(this)} name="program" className={checkbox}value="1"/>
<span>
<p className={p1}> paket A </p>
</span>
</label>
<label >
<input type="checkbox" onChange={this.onChange.bind(this)} name="program" className={checkbox}value="2"/>
<span>
<p className={p1}> paket B</p>
</span>
</label>
<label >
<input type="checkbox" onChange={this.onChange.bind(this)} name="program" className={checkbox}value={3}/>
<span>
<p className={p1}> paket C </p>
</span>
</label>
<label >
<input type="checkbox" onChange={this.onChange.bind(this)} name="program" className={checkbox}value={4}/>
<span>
<p className={p1}> English Regular 3 bulan </p>
</span>
</label>
<label >
<input type="checkbox" onChange={this.onChange.bind(this)} name="program" className={checkbox}value={5}/>
<span>
<p className={p1}> English Camp </p>
</span>
</label>
<label >
<input type="checkbox" onChange={this.onChange.bind(this)} name="program" className={checkbox}value={6}/>
<span>
<p className={p1}> English Private </p>
</span>
</label>
</div>
<div >
<div >
<br /><br />
<br />
<div >
<div >
<label className="text-white"> Kartu keluarga:</label>
<input type="file" name="upload_file"
onChange={this.handleInputChange} />
</div>
</div>
<div >
<div >
<label >ijazah :</label>
<input type="file" name="upload_file"
onChange={this.handleInputChange1} />
</div>
</div>
</div>
</div>
{this.state.enabled?<input type="submit" value="Kirim" className={submit}
/>:<input type="submit" value="Kirim" className={submitDisable} disabled/>}
</form>
<div><pre>{JSON.stringify(this.state.program) }</pre></div>;
</div>
</div>
<Footer/>
</div>
)
}
}
Open
Bug 1783432
Opened 6 months ago
Updated 6 months ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0
Steps to reproduce:
Sorry, no idea how to reproduce. Devtools Debugger just turned into a react error message.
Actual results:
This is the text of the error message:
Invariant Violation: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
React Component Stack
componentStack
in Connect(Editor)
in div
in div
in div
in div
in SplitBox
in div
in div
in SplitBox
in div
in A11yIntention
in AppErrorBoundary
in div
in App
in Connect(App)
in Provider
in Provider
Stacktrace
invariant@resource://devtools/client/shared/vendor/react-dom.js:34:15
reactProdInvariant@resource://devtools/client/shared/vendor/react-dom.js:62:4
scheduleWork@resource://devtools/client/shared/vendor/react-dom.js:15229:23
enqueueSetState@resource://devtools/client/shared/vendor/react-dom.js:8192:17
Component.prototype.setState@resource://devtools/client/shared/vendor/react.js:328:16
onStateChange@resource://devtools/client/shared/vendor/react-redux.js:1412:16
notify@resource://devtools/client/shared/vendor/react-redux.js:1159:21
notifyNestedSubs@resource://devtools/client/shared/vendor/react-redux.js:1198:20
notifyNestedSubsOnComponentDidUpdate@resource://devtools/client/shared/vendor/react-redux.js:1423:14
commitLifeCycles@resource://devtools/client/shared/vendor/react-dom.js:12958:22
commitAllLifeCycles@resource://devtools/client/shared/vendor/react-dom.js:14174:23
commitRoot@resource://devtools/client/shared/vendor/react-dom.js:14380:28
completeRoot/<@resource://devtools/client/shared/vendor/react-dom.js:15731:15
unstable_runWithPriority@resource://devtools/client/shared/vendor/react.js:617:12
completeRoot@resource://devtools/client/shared/vendor/react-dom.js:15730:27
performWorkOnRoot@resource://devtools/client/shared/vendor/react-dom.js:15659:21
performWork@resource://devtools/client/shared/vendor/react-dom.js:15567:24
performSyncWork@resource://devtools/client/shared/vendor/react-dom.js:15541:14
interactiveUpdates$1@resource://devtools/client/shared/vendor/react-dom.js:15808:7
interactiveUpdates@resource://devtools/client/shared/vendor/react-dom.js:1901:10
Expected results:
Debugger Tab should not crash
Thanks for filing! The error from the react documentation is
Maximum update depth exceeded.
This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.
React limits the number of nested updates to prevent infinite loops.
Martin: Did the error go away after you closed and re-opened the Debugger?
Any extra information you could share can be useful: what kind of script you were debugging? It seems like it crashed on a breakpoint, do you remember if you were stepping in/out or if this happened immediately when the debugger tried to stop on the breakpoint?
Flags: needinfo?(hier-bei-mir)
As far as I remember: No it did not go away, I tried clicking on another devtools tab (e.g. network) and then back to debugger, still showed the same error, also tried to close devtools and open again, still same error. I needed to reload the page to get rid of the error.
Yes I was inside the middle of a debugging session. The page I was debugging uses runtime compiled vue 2 components, I was debugging one of the computed functions of those components. It definitively happened after I set a breakpoint and I stepped over (just moving to next instruction) a few times. Though I am not sure if it happened after stepping over or after pressing play again to move to the next breakpoint (inside a loop).
That is all I got, sadly.
Flags: needinfo?(hier-bei-mir)
Severity: — → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: — → P3
Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
I’ve got this error when deployment
I heard this error can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.
But in my component I don’t have componentWillUpdate and componentDidUpdate.
why is it happening in my component?
this is my state init.
constructor(props) {
super(props);
this.state = {
isLoggedIn: false,
loading:false,
username:"",
password:"",
message:"",
alert:{
open: false,
type: "",
message: ""
}
this.handleClose = this.handleClose.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleFormSubmit = this.handleFormSubmit.bind(this);
and this is my handlers
handleClose(event, reason){
if (reason === "clickaway") {
return;
}
this.setState(prevState => ({
alert: {
...prevState.alert, open:false
}
}));
}
handleFormSubmit(e) {
e.preventDefault();
this.setState({loading:true})
this.Auth.login(this.state.username, this.state.password)
.then((res) => {
if(res.status == 200){
localStorage.setItem("username", this.state.username);
var ec2Ready = setInterval(()=>{
this.Auth.checkStatus(this.state.username)
.then((res)=>{
if(res.ready == true){
this.setState({loading:false, isLoggedIn:true})
clearInterval(ec2Ready)
}else{
this.setState(prevState=>({
...prevState, message: res.msg
}))
}
})
}, 8000)
}else{
this.setState({
loading:false,
alert:{ open: true, message:res.err, type:"error"}
});
}
})
.catch((err) => {
this.setState({
loading:false,
alert:{ open: true, message:err.response.statusText, type:"error"}
});
})
}
handleChange(e) {
this.setState({
[e.target.name]: e.target.value,
});
}
}