esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
2.95k stars 143 forks source link

Failed to import - @mui/material #817

Closed schlichtanders closed 2 months ago

schlichtanders commented 3 months ago

Failing module

import { createTheme } from "https://esm.sh/v135/@mui/material@5.15.15?dev&external=react,react-dom&target=es2020"

Error message

Uncaught TypeError: _interopRequireDefault is not a function
    npm colorManipulator.development.js:70
    __require2 colorManipulator.development.js:20
    <anonymous> build.js:1

Looking into the file, this is clearly because a call to require("@babel/runtime/...") got not translated to esm module.

Additional info

schlichtanders commented 2 months ago

@ije can you help investigating how to fix this?

mui/material is recommended by preact for preact components. And preact is awesome to build compilation-free frontends which code works same in browser and node - ideal for esm.sh usage

ije commented 2 months ago

i will look into it, thanks for reporting

schlichtanders commented 2 months ago

@ije have you had any success?

ije commented 2 months ago

i just added a patch for this, will deploy it later

ije commented 2 months ago

deployed, pealse try again thanks

schlichtanders commented 2 months ago

Thank you so much for your help and fix!

It works smoothly now :) finally I can use importmaps