vite-plugin-yaml icon indicating copy to clipboard operation
vite-plugin-yaml copied to clipboard

end of the stream or a document separator is expected

Open krmao opened this issue 2 years ago • 10 comments

image image

krmao avatar Aug 05 '23 02:08 krmao

Apologies for the late reply to this issue - would you be able to provide a sample YAML file that the transformation is throwing this error on?

tonyketcham avatar Nov 24 '23 21:11 tonyketcham

I currently have the same issue with this very simple yml file:

test: "value"

image

I tried different files, by checking if some white-spaces was mixed with tabs, but still not working properly.

With the version 1.0.2 it worked well

brandon-welsch avatar Feb 04 '24 14:02 brandon-welsch

@brandon-welsch if you switch the file to:

---
test: "value"

do you still see this issue?

tonyketcham avatar Feb 05 '24 05:02 tonyketcham

I tested this one, it's exactly the same :/

brandon-welsch avatar Feb 05 '24 10:02 brandon-welsch

Why isn't this fixed? It makes this package unsable.

lukaszarpak avatar Mar 27 '24 17:03 lukaszarpak

@lukaszarpak could you provide a minimal reproduction repo? I have not yet been able to reproduce this issue

tonyketcham avatar Mar 27 '24 17:03 tonyketcham

@tonyketcham I added the minimal reproduction repo: https://github.com/lukaszarpak/modyfi-vite-plugin-yaml-bug-example

After thorough investigation I noticed the error appears ONLY when @intlify/unplugin-vue-i18n vite's plugin is used in vite.config with include option passed in. Without this option there's no error and all works as expected.

export default defineConfig({
  plugins: [
    vue(),
    ViteYaml(),
    VueI18nPlugin({
      include: [resolve(__dirname, "./translations/**")], // this line breaks the app
    }),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})

lukaszarpak avatar Aug 13 '24 09:08 lukaszarpak

In our case that include option wasn't needed so we deleted it and everything works fine

lukaszarpak avatar Aug 13 '24 10:08 lukaszarpak

Actually this package @intlify/unplugin-vue-i18n seems to be completely redundant. Our app works perfectly fine without it. So I suppose this bug can be closed as it isn't related to Modyfi/vite-plugin-yaml package.

lukaszarpak avatar Aug 13 '24 10:08 lukaszarpak

I used i18n to load YAML on 2023/8/16 because the vite-plugin-yaml plugin was not usable at that time.

import { localesConfigs } from "@/plugins/i18n";

this.adminLoopData = localesConfigs.en[moduleName]?.adminLoopData;

I hadn't include any option that time, and still it can't be used, can be see on my picture uploaded.

if this bug was fixed, I will close the issue :)

krmao avatar Aug 13 '24 10:08 krmao