You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser version: Brave Version 1.73.89, Chromium: 131.0.6778.69 (Official Build) (64-bit)
The crux of the issue seems to be the attempt to import the @mdn/[email protected] package. I'm not really sure what's supposed to be at @mdn/[email protected]/es2022/browser-compat-data.mjs as this file is not part of the package or release.
I've made some attempts to solve the issue via aliasing.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/json". Strict MIME type checking is enforced for module scripts per HTML spec.
Aliasing to the JSON file with module transformation
the compatData object only has a default member containing the contents of the JSON object, and the subsequent code does not handle that nesting.
EDIT: This may actually be an issue inherent to the package itself which results in the ESM import erroneously nesting the data into the default export. If this is fixed, this alias solution should work.
Aliasing to entry point files
I've also tried aliasing to /import.d.mts and require.d.ts by way of /import.d.mjs and /require.d.js - and it was super neat to see that esm.sh actually compiles these TypeScript files for me. But either entry point expects /types.d.ts to have been compiled into /types.js, but esm.sh processes the /types.js URI into the nonexistent resource path
It is possible that I am overlooking some obvious solution here.
Failing module
Error message
After
onload
I got this:The code responsible for the request (
[email protected]:4
) is the following import:The response body at the indicated URL consists of the following:
Additional info
The crux of the issue seems to be the attempt to import the
@mdn/[email protected]
package. I'm not really sure what's supposed to be at@mdn/[email protected]/es2022/browser-compat-data.mjs
as this file is not part of the package or release.I've made some attempts to solve the issue via aliasing.
Aliasing to the RAW JSON file
This produces the following import statement, which does indeed produce the raw JSON file
However it ultimately results in the error
Aliasing to the JSON file with module transformation
For all purposes this looks like it should work. However, when another module executes the following import statement:
the
compatData
object only has adefault
member containing the contents of the JSON object, and the subsequent code does not handle that nesting.Aliasing to entry point files
I've also tried aliasing to
/import.d.mts
andrequire.d.ts
by way of/import.d.mjs
and/require.d.js
- and it was super neat to see that esm.sh actually compiles these TypeScript files for me. But either entry point expects/types.d.ts
to have been compiled into/types.js
, but esm.sh processes the/types.js
URI into the nonexistent resource path"/v135/.@latest/es2022/types.js"
instead of the existing
"/v135/@mdn/[email protected]/es2022/types.d.js"
I've tried to alias the former to the latter but have not succeeded thus far.
The text was updated successfully, but these errors were encountered: