liferay / liferay-js-toolkit

GNU Lesser General Public License v3.0
52 stars 41 forks source link

CSS stylesheets are not loaded after page refresh #619

Closed aggie2016 closed 4 years ago

aggie2016 commented 4 years ago

When deploying a React portlet, the first time the portlet is added to a widget page, the CSS styles work PERFECT. However, after reloading that same page, only a portion of the CSS seems to exist.

I'm using the recommended pattern of including all of my CSS stylesheets from a styles.css file in src/assets/styles.css.

├───assets
│   ├───css
│   │       antd.min.css
│   │       bootstrap-grid.min.css
│   │       bootstrap-grid.min.css.map
│   │       bootstrap-reboot.min.css
│   │       bootstrap-reboot.min.css.map
│   │       bootstrap.min.css
│   │       bootstrap.min.css.map
│   │       styles.css
│   │

In styles.css I've imported bootstrap.min.css, bootstrap-reboot.min.css, bootstrap-grid.min.css and antd.min.css

@import 'bootstrap.min.css';
@import 'bootstrap-reboot.min.css';
@import 'bootstrap-grid.min.css';
@import "antd.min.css";

In my package.json, I've included the following metadata as required for the bundler:

...

  "portlet": {
    "com.liferay.portlet.display-category": "APPS",
    "com.liferay.portlet.header-portlet-css": "/css/styles.css",
    "com.liferay.portlet.instanceable": true,
    "javax.portlet.name": "react-application",
    "javax.portlet.security-role-ref": "power-user,user",
    "javax.portlet.resource-bundle": "content.Language"
  }

We're using Liferay DXP 7.2.10.1 internally.

Has anyone encountered this issue and if so, has a resolution been determined?

izaera commented 4 years ago

I don't see how this is clearly related to the JS toolkit. It can be a problem in the portal, other tools used to build the project, whatever...

Please file a bug with support (if you have a subscription) or create a small project with the exact steps to reproduce, also specifying the versions of all the tools used to build it and the portal.

I will close this issue for now. Feel free to reopen it if you are sure this is a problem in the Toolkit itself. Thx.