Skip to content

import code snippet fail(BUG #1151 The situation still exists) #1297

Closed
@jiaming743

Description

@jiaming743
  • I confirm that this is a issue rather than a question.

Bug report

BUG #1151

According to @shigma 's advice

I removed ":"

myVuePressProject/node_modules/vuepress/lib/markdown/snippet.js#27

Before

const filename = rawPath.split(/[{:\s]/).shift()

After

const filename = rawPath.split(/[{\s]/).shift()

It still shows Not found: E

What's more

I tried console.log(content) and the contents of the file can be read normally.

myVuePressProject/node_modules/vuepress/lib/markdown/snippet.js#28

const content = fs.existsSync(filename) ? fs.readFileSync(filename).toString() : 'Not found: ' + filename

Version

VuePress@0.14.8

Steps to reproduce

What is expected?

show codes what I imported

What is actually happening?

show me Not found: E

Other relevant information

  • Your OS: Windows 10
  • Node.js version: 10.13.0
  • Browser version: Chrome 70.0.3538.102
  • Is this a global or local install? * (vuepress@0.14.8) and local (vuepress@0.14.8)
  • Which package manager did you use for the install? yarn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions