Open aschempp opened 6 years ago
@aschempp How can this be recreated? The CLI tool should not even show components that don't have any strings in them to be translated.
I fixed a bug in 1.1.0
that lead to the same error message. Could you try again and check if it works now?
Thanks for the update! Now I get a slightly different message:
(node:36976) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token } in JSON at position 5186 (node:36976) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The component is rather simple, here's what it looks like:
<template>
<div id="app">
<error v-if="$store.state.error"/>
<router-view v-else/>
</div>
</template>
<script>
// import "../../template/lib/jquery/jquery.js";
// import "../../template/lib/popper.js/popper.js";
// import "../../template/lib/bootstrap/js/bootstrap.js";
import Error from './layouts/Error';
export default {
components: { Error },
created() {
this.$store.dispatch('auth/refresh');
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
@import "../assets/template/lib/perfect-scrollbar/css/perfect-scrollbar.css";
@import "../assets/template/lib/jquery.steps/jquery.steps.css";
@import "../assets/template/lib/SpinKit/spinkit.css";
@import "../assets/template/css/bracket";
@import "../assets/styles/app";
</style>
I tried removing everything except the div and export statement, and the error still comes up.
I'm failing to recreate this. Could the error actually be from your messages file(s)? Sorry the error handling is still very basic.
When does the error occur? Right after running translate
or only after selecting a file?
After selecting that file. Other files work just fine. All languages are stored in the same file. Here's what my config looks like:
const path = require('path');
const { JSONAdapter } = require('vue-translation-manager');
module.exports = {
srcPath: path.join(__dirname, 'src/components/'),
adapter: new JSONAdapter({ path: path.join(__dirname, 'src/i18n/messages.json')}),
languages: ['en', 'de'],
};
I can not recreate this, still. Is the messages file valid JSON? Did you try to validate this?
Could you provide a small reproducable example so i could look into this?
I can confirm the issue but I am not sure what's the source of the problem…
@qzminski @MaxGfeller Turns out it shows this error if any of your templates contains an &
or /
or anything that can't be uppercased :joy:
If a file does not have any translations, the CLI tool will terminate with an error: