My Angular 5 project was working without issues, just
after having updated it to version 6, it stopped building using ng
due to the next:
build
readability="6">
ERROR in ./src/app/assets/i18/en.json
Module parse failed: Unexpected
token in JSON at position 0 You may need an
appropriate loader to
handle this file
type.
here is my
json
file:
{
"app":
{
"Welcome": "Welcome",
"New": "New"
},
"mainMenu": {
"Home": "Home",
"Logout":
"Logout"
},
"pageHeader": {
"About":
"About",
"Settings": "Settings"
}
}
Most
solutions on the web are talking about href="https://github.com/webpack-contrib/copy-webpack-plugin" rel="nofollow
noreferrer">CopyWebpackPlugin but the project doesn't use any Webpack
configuration file.
then, following href="https://stackoverflow.com/questions/5034444/can-json-start-with?answertab=active#tab-top">this
link I tried to make the json as an
array:
{
"menu":[
"app": {
"Welcome": "Welcome",
"New": "New"
},
"mainMenu": {
"Home":
"Home",
"Logout": "Logout"
},
"pageHeader":
{
"About": "About",
"Settings": "Settings"
}
]
}
But got
the following error, despite the file contains 16
lines.
Unexpected token : in JSON at position
24
Any
idea ?
No comments:
Post a Comment