evilmartians / oklch-picker

Color Picker for LCH
https://oklch.com
Other
849 stars 65 forks source link

Failed to load module script in Chromium browsers #9

Closed dpschen closed 2 years ago

dpschen commented 2 years ago

Works in Safari though.

Console shows:

image

ai commented 2 years ago

Confirm. Going to debug it.

ai commented 2 years ago

Hot fix 3faf0f6

Will think about proper solution later.

ai commented 2 years ago

Fixed properly https://github.com/evilmartians/oklch-picker/commit/e96b19927e147e1c97bd35cad7cc39ce209a6df6

Thanks for the report

dpschen commented 2 years ago

Thanks! Interesting fix. May I ask what the root of the problem was?

PS: Also amazing project by the way. Was in a rush when I wrote this issue. I‘m really looking forward to use oklch with real projects.

ai commented 2 years ago

May I ask what the root of the problem was?

.ts file extension officially is not TypeScript, but MPEG container video/mp2t.

When Vite tries to data:uri TS files, it uses some library with MIME types and use video/mp2t instead of application/javascript.

I moved to stand-alone file and it solved the problem.