slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
32.67k stars 1.31k forks source link

import issue of lz-string in 0.49.16 #1861

Open zillionare opened 1 week ago

zillionare commented 1 week ago

Describe the bug

This is an old bug (#1348 ), but it reappeared in version 0.49.16 again, when I try to enable monaco editor.

Minimal reproduction

Steps to reproduce the behavior:

the source md:

start = datetime.date(2023, 1, 1)
end = datetime.date(2023, 12, 31)
barss = load_bars(start, end)
barss.tail()

monaco configuration(theme/setup/monaco.ts):

import { defineMonacoSetup } from '@slidev/types'

export default defineMonacoSetup(async (monaco) => {
    // use `monaco` to configure
})

I have compared my local Monaco.vue with your repo (main branch, latest version), seems like the version has rolled back:

// latest in main branch
<script setup lang="ts">
import { debounce } from '@antfu/utils'
import lz from 'lz-string'

in #1348 , it was:

图片

Not sure if this cause the issue.

Environment

If you are using Slidev globally (i.e. npx slidev or npm i -g slidev), please try to reproduce the issue in a local project (i.e. npm create slidev@latest).

KermanX commented 6 days ago

Does this happen in the latest version?

zillionare commented 6 days ago

with version 0.49.29, the issue still exists:

slide failed to load SyntaxError: The requested module 'http://192.168.100.5:3030/@fs/apps/slidev_themes/node_modules/lz-string/libs/lz-string.js?v=e101dc9b' doesn't provide an export named: 'default'

my shiki settings(not sure if it's related):

// import { transformerMetaWordHighlight, transformerNotationDiff } from '@shikijs/transformers'
import { defineShikiSetup } from '@slidev/types'

console.log("configure shiki from landscape-jade")
export default defineShikiSetup(() => {
    return {
        themes: {
            dark: 'min-dark',
            light: 'min-light',
        }
        // transformers: [
        //     transformerNotationDiff(),
        //     transformerMetaWordHighlight(),
        // ]
    }
})

the issue exists no matter the lines are commented out or not.