NullVoxPopuli / ember-resources

An implementation of Resources. Supports ember 3.28+
https://github.com/NullVoxPopuli/ember-resources/blob/main/docs/docs/README.md
MIT License
91 stars 37 forks source link

API docs loading issue due to incorrect MIME type of styles and scripts #1036

Closed johanrd closed 2 weeks ago

johanrd commented 10 months ago
  1. Go here: https://ember-resources.pages.dev/functions/use.html
  2. See that sub pages of the api docs refuse to load scripts and style because the MIME type is not supported:
Screenshot 2023-11-07 at 13 32 55
Refused to apply style from 'https://ember-resources.pages.dev/functions/assets/highlight.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
use.html:1 Refused to apply style from 'https://ember-resources.pages.dev/functions/assets/custom.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
use.html:1 Refused to execute script from 'https://ember-resources.pages.dev/functions/assets/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
use.html:1 Refused to apply style from 'https://ember-resources.pages.dev/functions/assets/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
use.html:1 Refused to execute script from 'https://ember-resources.pages.dev/functions/assets/navigation.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
use.html:1 Refused to execute script from 'https://ember-resources.pages.dev/functions/assets/search.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
NullVoxPopuli commented 10 months ago

For step 1, where'd you get that link?

Anywho, The underlying issue is all Cloudflare breaking things. Here is the background: https://github.com/cloudflare/workers-sdk/issues/2240#issuecomment-1685032081

This caused it: https://github.com/cloudflare/workers-sdk/pull/2103

NullVoxPopuli commented 10 months ago

the page you're looking for is here: https://ember-resources.pages.dev/funcs/use.html

It seems the script that rewrites functions to funcs forgot about some links in the nav https://github.com/NullVoxPopuli/ember-resources/blob/main/.github/workflows/ci.yml#L261

johanrd commented 10 months ago

Ah, thanks, hehe,

Step -2: Go to the main site of the repository: https://github.com/NullVoxPopuli/ember-resources Step -1: Click link to "API Reference" in section Documentation

Screenshot 2023-11-07 at 14 19 35

this links you to https://ember-resources.pages.dev/modules

Step: 0: Click on "use"

Screenshot 2023-11-07 at 14 19 28

this links you to https://ember-resources.pages.dev/functions/use.html

johanrd commented 8 months ago

@NullVoxPopuli The docs navigation is still broken.

Could it be as easy as this?

https://github.com/NullVoxPopuli/ember-resources/blob/main/docs/typedoc.config.json

  "sidebarLinks": {
-    "link": "/functions/link.link.html",
-    "modifier": "/functions/modifier.modifier.html",
-    "service": "/functions/service.service.html",
-    "RemoteData": "/functions/util_remote_data.RemoteData.html",
-    "UpdateFrequency": "/functions/util_fps.UpdateFrequency.html",
-    "keepLatest": "/functions/util_keep_latest.keepLatest.html",
-    "debounce": "/functions/util_debounce.debounce.html",
-    "map": "/functions/util_map.map.html",
-    "trackedFunction": "/functions/util_function.trackedFunction.html",
-    "trackedTask": "/functions/util_ember_concurrency.trackedTask.html",
-    "helper": "/functions/util_helper.helper.html"
+    "link": "/funcs/link.link.html",
+    "modifier": "/funcs/modifier.modifier.html",
+    "service": "/funcs/service.service.html",
+    "RemoteData": "/funcs/util_remote_data.RemoteData.html",
+    "UpdateFrequency": "/funcs/util_fps.UpdateFrequency.html",
+    "keepLatest": "/funcs/util_keep_latest.keepLatest.html",
+    "debounce": "/funcs/util_debounce.debounce.html",
+    "map": "/funcs/util_map.map.html",
+    "trackedFunction": "/funcs/util_function.trackedFunction.html",
+    "trackedTask": "/funcs/util_ember_concurrency.trackedTask.html",
+    "helper": "/funcs/util_helper.helper.html"
  },
NullVoxPopuli commented 8 months ago

Could it be as easy as this?

Probably! Do you want to submit a pr?

NullVoxPopuli commented 8 months ago

perhaps I need to not use cloudflare for typedoc deployments :(

johanrd commented 8 months ago

seems fixed now!

johanrd commented 2 weeks ago

Reopening, the issue is back now.

  1. Go here: https://ember-resources.pages.dev/
  2. Click on resourceFactory
  3. See missing styles due to Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.:
Screenshot 2024-08-23 at 13 33 59
NullVoxPopuli commented 2 weeks ago

grrrrr this functions thing oof

NullVoxPopuli commented 2 weeks ago

ah, in protest, I moved the docs here to Vercel: https://ember-resources.nullvoxpopuli.com