Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adricen opened this issue Sep 18, 2024 · 0 comments
Open

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

adricen opened this issue Sep 18, 2024 · 0 comments

Comments

@adricen
Copy link

adricen commented Sep 18, 2024

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/[email protected]"
contentType: "image"
script: <script>console.log("hello")</script>
---

# Title from Project 1

> content and all stuff

Something


Thank for any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant