Button does not render properly after production build.


Topic: Button does not render properly after production build.

Csaba Balogh asked 6 years ago

Button renders properly in developer mode. In production mode the button is completely off. In other words: when I run npm start my button looks as expected. But when I run npm run build then serve -s build the button looks completely different. It looks like the production build does not import the buttons on any sub page for some reason.

See the site below:

see the website here

See picture screenshots below: the screenshot on the top is the expected behavior and the bottom screenshot is production build vs developer build

package.json: "dependencies": { "aws-sdk": "^2.429.0", "axios": "^0.18.0", "babel-core": "^6.26.3", "mdbreact": "^4.11.1", "react": "^16.8.4", "react-dom": "^16.8.4", "react-router-dom": "^4.3.1", "react-scripts": "2.1.8" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": "react-app" }, "browserslist": [ ">0.2%", "not dead", "not ie <= 11", "not op_mini all" ], "devDependencies": { "@babel/core": "^7.4.0" } }

I have no idea at this point what is causing it.


Jakub Mandra staff premium answered 6 years ago

Hi,

I see that you use create-react-app. I tried to reproduce the problem, but with no 'success'.

With cra you do not need to install additional babel package, but I'm not sure if this is the source of the issue. Maybe you have custom css somewhere in the project?

Best,

Jakub


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.11.1
  • Device: all device
  • Browser: all browsers
  • OS: all operating system
  • Provided sample code: No
  • Provided link: Yes