Code Monkey home page Code Monkey logo

Comments (3)

tuanlc avatar tuanlc commented on August 11, 2024 1

Solution:

We need to make mdi.svg available on any mode of deployment. And we should not send the request to server to get this kind of resource like we did for templates.

And because we have 2 places to set default icon for material at core and inbox

So solution is serving the mdi.svg in frontend and having 1 global config block to set default icon

Steps:

  • Serve mdi.svg in esn-frontend-common-libs
  • Have 1 config block to set default icon in esn.material module
  • Require esn.material module in SPAs
  • Remove the config in inbox & esn.user-profile modules

from esn-frontend-common-libs.

tuanlc avatar tuanlc commented on August 11, 2024

Information: This error appears only on dev platform with production deployment

from esn-frontend-common-libs.

tuanlc avatar tuanlc commented on August 11, 2024

The reason, in the frontend, we setup default icon for angular material:

$mdIconProvider.defaultIconSet('images/mdi/mdi.svg', 24);

And this performs a request to ESN backend to get the mdi.svg resource.

Why does it work on devServer?

Because with Webpack devServer proxy, we forward the request from localhost:9900 to server base URL, then the request is:

https://dev.open-paas.org/images/mdi/mdi.svg

And it works like before in the old code base

Why production deployment on DEV server doesn't work?

Because the base URL of SPA has additional route: https://dev.open-paas.org/contacts/ Then the mdi request becomes:

https://dev.open-paas.org/contacts/images/mdi/mdi.svg

And the request is 404

from esn-frontend-common-libs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.