Closed TuxGit closed 5 years ago
Hi, @TuxGit!
Thanks for the detailed bug report!
It took some time, but I found a problem. I've tested Uibook with outdated Create React App which uses Webpack 3.x. There are lots of changes in chunk splitting in Webpack 4.x, that's why it was broken. I fixed it in the 0.5.2 version.
Also, there is a limitation with the default Create React App webpack config. It is supposed that there will be an only single bundle, so Uibook can't start. Please refer to the updated troubleshooting page.
Please upgrade and let me know if it works now :)
Also, here is an example src/button.js
which is not included in docs. It might be useful for quick start with CRA:
import React, { Component } from 'react';
class Button extends Component {
render () {
return (
<button
onClick={ this.props.onClick }
style={{
background: '#FF7E79',
padding: '5px 15px',
border: 'none'
}}
>{ this.props.children }</button>
);
}
}
export default Button;
@vrizo Thanks, it worked! Today I tested with eject and able to run with a plugin "react-app-rewired" (know this is not the best practice). I hope the tool will be useful in a new project!)
I apologize for the long wait =)
@TuxGit , Wow, great, I'm glad to hear it! Thank you! Please let me know if you have any questions or suggestions.
I try use the uibook with project based on create-react-app. Dev server starts ok, but page /uibook is empty/white. Console is clear (no errors).
My steps:
npx create-react-app .
npm run eject
yarn add uibook
yarn start
Versions:
P.S. sometimes an error occurs
webpackHotUpdate is not defined
- I think this is not the main problem.