Fix ui render call, improve error message (#294)

This commit is contained in:
Elliot 2022-09-14 08:11:42 -04:00 committed by GitHub
parent 735bd983a5
commit ce79d3cd95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -120,7 +120,8 @@ export default class Project {
`while you are using @theatre/core along with @theatre/studio. But since @theatre/studio ` + `while you are using @theatre/core along with @theatre/studio. But since @theatre/studio ` +
`is not loaded, the state of project "${id}" will be empty.\n\n` + `is not loaded, the state of project "${id}" will be empty.\n\n` +
`To fix this, you need to add @theatre/studio into the bundle and export ` + `To fix this, you need to add @theatre/studio into the bundle and export ` +
`the project's state. Learn how to do that at https://docs.theatrejs.com/in-depth/#exporting`, `the project's state. Learn how to do that at https://docs.theatrejs.com/in-depth/#exporting\n` +
`If you are using a framework like Next.js, this error may be caused by running Theatre on the server side.`,
) )
} }
}, 1000) }, 1000)

View file

@ -148,7 +148,7 @@ export class Studio {
this._initializedDeferred.resolve() this._initializedDeferred.resolve()
if (process.env.NODE_ENV !== 'test') { if (process.env.NODE_ENV !== 'test' && this.ui) {
this.ui.render() this.ui.render()
checkForUpdates() checkForUpdates()
} }