Skip to content

[Feature]: support native ESM modules from CDN #23508

@Hotell

Description

@Hotell

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

ATM v9 ships only as CommonJS and ESM module format.

Trying to use ESM from CDN fails as unpkg.com uses wrong content-type for ES modules thus user gets following error:

🚨 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec..

Instead content-type: text/html; it should use content-type: text/javascript;.

Repro: https://stackblitz.com/edit/web-platform-jskm9z?file=index.html

Trying to mitigate this via skypack CDN fixes this partially but fails short on react-icons package:

image

Have you discussed this feature with our team

No response

Additional context

No response

Validations

  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions