Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Setting MIME type in http-server doesn't work

Setting MIME type in http-server doesn't work

Scheduled Pinned Locked Moved Solved App Packaging & Development
4 Posts 2 Posters 323 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • KubernetesK Offline
      KubernetesK Offline
      Kubernetes
      App Dev
      wrote on last edited by Kubernetes
      #1

      Hi there,

      I am trying to package the Chatpad App for cloudron and have problems with the MIME Type of the .tsx Files.

      Browser Log (Console):

      failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". 
      Strict MIME type checking is enforced for module scripts per HTML spec.
      

      The current source can be found in Github

      I tried to handover the mime.types file to http-server in start.sh , but I still get the error above in the Browsers console.

      Any idea why the correct mime type is not used?

      Best,
      Mike

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #2

        Are you sure the tsx files should be delivered as such and will not be first compile to plain js files?
        Usually apps have some npm run build or such hook to assemble the app into a dist/ folder.

        1 Reply Last reply
        1
        • KubernetesK Offline
          KubernetesK Offline
          Kubernetes
          App Dev
          wrote on last edited by
          #3

          Ah, great hint! Thank you... working on it now

          1 Reply Last reply
          0
          • KubernetesK Offline
            KubernetesK Offline
            Kubernetes
            App Dev
            wrote on last edited by
            #4

            Problem solved after compiling the source 😉

            1 Reply Last reply
            0
            • nebulonN nebulon marked this topic as a question on
            • nebulonN nebulon has marked this topic as solved on
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search