Skip to content

Commit

Permalink
fix(addon-bangumi): runtime error in browser (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
WRXinYue authored Aug 24, 2024
1 parent a58ca38 commit 7cdd0aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/valaxy-addon-bangumi/components/ValaxyBangumi.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<script setup lang="ts">
/**
* The ESM module will be mistakenly identified as CJS. Importing like this:
* import { defineCustomElements } from "bilibili-bangumi-component/loader";
*
* reference https://github.com/YunYouJun/valaxy/pull/346
*/
// eslint-disable-next-line ts/ban-ts-comment
// @ts-expect-error
import { defineCustomElements } from 'bilibili-bangumi-component/dist/cjs/loader.cjs'
import { onMounted, ref } from 'vue'
import { isClient } from '@vueuse/core'
import { useAddonBangumi } from '../client'
defineCustomElements()
(async () => {
if (!isClient)
return
const { defineCustomElements } = await import('bilibili-bangumi-component/loader')
defineCustomElements()
})()
const bangumiRef = ref<HTMLElement>()
Expand Down
1 change: 1 addition & 0 deletions packages/valaxy-addon-bangumi/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "valaxy-addon-bangumi",
"type": "module",
"version": "0.2.0",
"description": "Bangumi addon for Valaxy",
"repository": {
Expand Down

1 comment on commit 7cdd0aa

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://66ca2778d4764dde45cdf24c--valaxy.netlify.app

Please sign in to comment.