slidevjs / slidev

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

Navigation bar disappear and Code highlight doesn't work #704

Closed Crowds21 closed 2 years ago

Crowds21 commented 2 years ago

Describe the bug The button still works, but the navigation bar doest not display. Highlighting a specific line of a code block does not work. These functions can be used normally in v0.34.2

To Reproduce npm init slidev@latest
npm run dev

Desktop (please complete the following information):

Bruce-Ming commented 2 years ago

me too

{ "name": "share", "private": true, "scripts": { "build": "slidev build", "dev": "slidev --open", "export": "slidev export" }, "dependencies": { "@slidev/cli": "^0.35.6", "@slidev/theme-default": "", "@slidev/theme-seriph": "" } }

Possible dependency issues? Issues with peer dependencies found . └─┬ @slidev/cli └─┬ @slidev/client └─┬ @vueuse/motion └── βœ• unmet peer @nuxt/kit@npm:@nuxt/kit-edge@latest: found 3.0.0-rc.10-27708028.1ca294e

[Vue warn]: Failed to resolve component: carbon:stop-outline If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. image

welcoMattic commented 2 years ago

Same here, it breaks from 0.35.0

LAWTED commented 2 years ago

me too, but 0.35.4 works well

twitwi commented 2 years ago

I can reproduce the issue (linux, firefox) for the bar, the code highlighting seems to work.

twitwi commented 2 years ago

The first console warnings that are abnormal are about __DEV__,__SLIDEV_FEATURE_DRAWINGS__ etc not found

image

@tonai As you worked on the build part, maybe you're familiar with these kind of errors? (although these are in dev mode)

tonai commented 2 years ago

Hum environment variables should be replaced by the build tool. The plugin responsible for this is defined in that file: https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/plugins/patchTransform.ts And the environment variables are defined in the getDefine method located in that file: https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/plugins/extendConfig.ts It only transforms file with the .vue extension. I don't really know why this is broken...

twitwi commented 2 years ago

I confirm it break by switching from 0.34.3 to 0.35.0, which seems to be only made of an upgrade to vite3.

twitwi commented 2 years ago

But no issue when running the demo presentation with a clone and build of v0.35.6 (or any version probably).

Crowds21 commented 2 years ago

I can reproduce the issue (linux, firefox) for the bar, the code highlighting seems to work.

Now I am using v0.36.4. The navigation bar works well. But Line Highlighting still can't work. Sorry, I didn't express the issue accurately.

This is the picture for http://127.0.0.1:3030/4

image

And it is the same result for http://127.0.0.1:3030/4?clicks=1

The Line Highlighting doesn't work for ts {all|2|1-6|9|all}. It highlights all lines all the time .