Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import - @douyin/semi-ui #393

Closed
gwsbhqt opened this issue Aug 5, 2022 · 5 comments
Closed

Failed to import - @douyin/semi-ui #393

gwsbhqt opened this issue Aug 5, 2022 · 5 comments
Labels
browser Not working in Browser

Comments

@gwsbhqt
Copy link

gwsbhqt commented Aug 5, 2022

Failing module

import * as SemiUI from 'https://esm.sh/@douyinfe/semi-ui'

Error message

Everything seems to be ok, but for .scss style files it hangs up

eg.

for https://esm.sh/v89/@douyinfe/[email protected]/es2022/lib/es/popover/popover.css.js:

timeout, we are building the package hardly, please try again later!

Additional info

  • esm.sh version: v89
  • Browser version: edge v103
@gwsbhqt gwsbhqt added the browser Not working in Browser label Aug 5, 2022
@ije
Copy link
Member

ije commented Aug 5, 2022

@gwsbhqt
Copy link
Author

gwsbhqt commented Aug 5, 2022

save the following code as a .html suffix file and open it with your browser, and open the browser debugger to observe

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
    </head>
    <body></body>
    <script type="module">
        import * as SemiUI from 'https://esm.sh/@douyinfe/semi-ui'
        console.log(SemiUI)
    </script>
</html>

After waiting for a period of time, you can observe that the files with the .js suffix are loaded successfully, but all the files with the .css.js suffix fail to load, some are hanged for a long time and no response, some report 500, some report 520, some report 521.

image

image

According to the compiled source code, it is found that the .css.js file is directly imported.
compiled_code

According to the source code, it is a directly imported .scss file.
source_code

image

image

could it be because esm.sh is missing the scss loader?

@gwsbhqt
Copy link
Author

gwsbhqt commented Aug 5, 2022

By the way, I found a puzzling phenomenon.

I use the Bundle mode import has been unable to build and import success, always time out.
But importing using css mode can be successfully imported.

eg.

bundle mode imported always timeout
https://esm.sh/@douyinfe/semi-ui?bundle

css mode imported success
https://esm.sh/@douyinfe/semi-ui?css ->
https://esm.sh/v89/@douyinfe/[email protected]/es2022/semi-ui.css

@XterioTech
Copy link

XterioTech commented Nov 29, 2024

顺便说一句,我发现一个令人费解的现象。

我使用Bundle模式导入一直无法构建并导入成功,总是超时。 但是使用css模式导入可以成功导入。

例如。

捆绑模式导入总是超时 https://esm.sh/@douyinfe/semi-ui?bundle

css 模式导入成功 https://esm.sh/@douyinfe/semi-ui?css-> https://esm.sh/v89/@douyinfe/[email protected]/es2022/semi-ui.css

https://esm.sh/v135/@douyinfe/[email protected]/es2022/semi-ui.css file not found
https://esm.sh/v89/[email protected]/es2022/element-plus.css fle not found
how to fix it

@chenweigh
Copy link

顺便说一句,我发现一个令人费解的现象。
我使用Bundle模式导入一直无法构建并导入成功,总是超时。 但是使用css模式导入可以成功导入。
例如。
捆绑模式导入总是超时 https://esm.sh/@douyinfe/semi-ui?bundle
css 模式导入成功 https://esm.sh/@douyinfe/semi-ui?css-> https://esm.sh/v89/@douyinfe/[email protected]/es2022/semi-ui.css

https://esm.sh/v135/@douyinfe/[email protected]/es2022/semi-ui.css file not found https://esm.sh/v89/[email protected]/es2022/element-plus.css fle not found how to fix it

@gwsbhqt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Not working in Browser
Projects
None yet
Development

No branches or pull requests

4 participants