vite-plugin-yaml
vite-plugin-yaml copied to clipboard
end of the stream or a document separator is expected
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?
I currently have the same issue with this very simple yml file:
test: "value"
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 if you switch the file to:
---
test: "value"
do you still see this issue?
I tested this one, it's exactly the same :/
Why isn't this fixed? It makes this package unsable.
@lukaszarpak could you provide a minimal reproduction repo? I have not yet been able to reproduce this issue
@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))
}
}
})
In our case that include option wasn't needed so we deleted it and everything works fine
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.
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 :)