Skip to content

Vite compiler issue - Expecting Unicode escape sequence \uXXXX. #502

@adricen

Description

@adricen

Hello,

I didn't manage to make the plugin work. I made it this far from now. It seams to parse the file as it should but I still have a compiler issue.

Screenshot from 2024-09-18 08-53-52

I don't know what I should do next to deal with this. next you'll find vite config file and my minimal vue template and md file :

vite-config.ts

import { defineConfig } from 'vite'
import {plugin as mdPlugin, Mode} from 'vite-plugin-markdown'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url';

// https://vitejs.dev/config/
export default defineConfig({
  base: '/',
  plugins: [
    vue({
      include: [/\.vue$/, /\.md$/],
    }),
    mdPlugin({
      mode: [
        Mode.HTML,
        // Mode.TOC,
        Mode.VUE
      ],
    }),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      buffer: 'buffer',
    },
  },
  optimizeDeps: {
    include: ['buffer']
  },
  server: {
    watch: {
      usePolling: true,
    }
  },
  build: {
    sourcemap: true,
  },
})

vue component where I want to import my md file

<script setup lang="ts">

import { attributes, html, VueComponent, VueComponentWith }  from '@/assets/portfolio/project-1.md' 
console.log("attributs :", attributes)

</script>
<template> 
  </section>
</template>

my md file as test

---
title: "Application UCPA - Storyline"
slug: "project-1"
description: "le texte qui va bien"
tags: ["UI", "Art", "direction"]
thumbnail: "https://c.animaapp.com/57i96tuF/img/image-7@2x.png"
contentType: "image"
script: <script>console.log("hello")</script>
---

# Title from Project 1

> content and all stuff

Something


Thank for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions