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

end of the stream or a document separator is expected #18

Open
krmao opened this issue Aug 5, 2023 · 10 comments
Open

end of the stream or a document separator is expected #18

krmao opened this issue Aug 5, 2023 · 10 comments

Comments

@krmao
Copy link

krmao commented Aug 5, 2023

image image
@tonyketcham
Copy link
Collaborator

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?

@brandon-welsch
Copy link

brandon-welsch commented Feb 4, 2024

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

@tonyketcham
Copy link
Collaborator

tonyketcham commented Feb 5, 2024

@brandon-welsch if you switch the file to:

---
test: "value"

do you still see this issue?

@brandon-welsch
Copy link

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

@lukaszarpak
Copy link

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

@tonyketcham
Copy link
Collaborator

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

@lukaszarpak
Copy link

lukaszarpak commented Aug 13, 2024

@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
Copy link

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

@lukaszarpak
Copy link

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.

@krmao
Copy link
Author

krmao commented Aug 13, 2024

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 :)

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

4 participants