Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.


Hi I have this error Failed to parse JSON file, invalid JSON syntax found at line 2084

I know de error is not in the .json file, so Iḿ asking me how to setting server.hmr.overlay to false in vite.config.js. in the proper way to see if itś solves my problemt. Thanks...

this is the .json by the way:

{
"paises" : [
{
"code": "CY",
"name": "cyprus",
"coords": {"lat":35, "lng":33 },
"cities": [ {"Nicosia":{"coords": {"lat":35.1748976,"lng":33.3638568}}}, {"Limassol":{"coords": {"lat":34.6852901,"lng":33.0332657}}}, {"Larnaca":{"coords": {"lat":34.9236095,"lng":33.6236184}}}, {"Paphos":{"coords": {"lat":34.7743988,"lng":32.4231586}}}, {"Famagusta":{"coords": {"lat":35.1245436,"lng":33.9325419}}}, {"Kyrenia":{"coords": {"lat":35.3352654,"lng":33.3188405}}}, {"Protaras":{"coords": {"lat":35.0149462,"lng":34.0531284}}}, {"Polis":{"coords": {"lat":35.034477,"lng":32.426471}}}, {"Paralimni":{"coords": {"lat":35.0391526,"lng":33.9828013}}}, {"Ayia Napa":{"coords": {"lat":34.9893216,"lng":33.9962036}}},{"Latchi":{"coords": {"lat":35.0408113,"lng":32.393906}}},{"Peyia":{"coords": {"lat":34.8835052,"lng":32.3803202}}},{"Deryneia":{"coords": {"lat":35.064867,"lng":33.9609128}}},{"Xylofagou":{"coords": {"lat":34.9772326,"lng":33.8491973}}},{"Dherynia":{"coords": {"lat":35.064867,"lng":33.9609128}}},{"Frenaros":{"coords": {"lat":35.0421958,"lng":33.9223452}}},{"Chlorakas":{"coords": {"lat":34.7995901,"lng":32.4079198}}},{"Kiti":{"coords": {"lat":34.8456226,"lng":33.5726051}}},{"Episkopi":{"coords": {"lat":34.7956542,"lng":32.5255332}}},{"Oroklini":{"coords": {"lat":34.9822755,"lng":33.6558552}}},{"Ypsonas":{"coords": {"lat":34.6903956,"lng":32.9631519}}},{"Sotira":{"coords": {"lat":35.0266887,"lng":33.9501971}}},{"Tala":{"coords": {"lat":34.8361333,"lng":32.4309763}}},{"Tersephanou":{"coords": {"lat":34.8542663,"lng":33.5481056}}},{"Anafotida":{"coords": {"lat":34.809974600000004,"lng":33.46309269314502}}},{"Mazotos":{"coords": {"lat":34.799448299999995,"lng":33.49812903806328}}},{"Avgorou":{"coords": {"lat":35.0356292,"lng":33.8401465}}},{"Kokkinotrimithia":{"coords": {"lat":35.1542715,"lng":33.1986543}}},{"Zygi":{"coords": {"lat":34.7289972,"lng":33.3380216}}},{"Pissouri":{"coords": {"lat":34.6689046,"lng":32.7010481}}},{"Mandria":{"coords": {"lat":34.869402,"lng":32.8307201}}} ],
},
{
"code": "RU",
"name": "russia",
"coords": {"lat":60, "lng":100 },
"cities": [ {"moscu":{"coords": {"lat":55.7504461,"lng":37.6174943}}},{"Petrogrado":{"coords": {"lat":59.938732,"lng":30.316229}}},{"Novosibirsk":{"coords": {"lat":55.0282171,"lng":82.9234509}}},{"Nizhniy Novgorod":{"coords": {"lat":56.3264816,"lng":44.0051395}}},{"Samara":{"coords": {"lat":53.198627,"lng":50.113987}}},{"Omsk":{"coords": {"lat":54.991375,"lng":73.371529}}},{"Kazan":{"coords": {"lat":55.7823547,"lng":49.1242266}}},{"Rostov del Don":{"coords": {"lat":47.2216548,"lng":39.7096061}}},{"Cheliabinsk":{"coords": {"lat":55.1598408,"lng":61.4025547}}},{"Ufa":{"coords": {"lat":54.7261409,"lng":55.947499}}},{"Volgograd":{"coords": {"lat":48.7081906,"lng":44.5153353}}},{"Perm":{"coords": {"lat":58.5951603,"lng":56.3159546}}},{"Krasnoyarsk":{"coords": {"lat":63.3233807,"lng":97.0979974}}},{"Saratov":{"coords": {"lat":51.530018,"lng":46.034683}}},{"Voronezh":{"coords": {"lat":51.6605982,"lng":39.2005858}}},{"Toliatti":{"coords": {"lat":53.5149884,"lng":49.4073316}}},{"Krasnodar":{"coords": {"lat":45.7684014,"lng":39.0261044}}},{"Ulyanovsk":{"coords": {"lat":54.3107593,"lng":48.3642771}}},{"Izhevsk":{"coords": {"lat":56.866557,"lng":53.2094166}}},{"Yaroslavl":{"coords": {"lat":57.6263877,"lng":39.8933705}}},{"Barnaul":{"coords": {"lat":53.3475493,"lng":83.7788448}}},{"Vladivostok":{"coords": {"lat":43.1150678,"lng":131.8855768}}},{"Irkutsk":{"coords": {"lat":56.6370122,"lng":104.719221}}},{"Jabarovsk":{"coords": {"lat":48.4812568,"lng":135.0762968}}},{"Oremburgo":{"coords": {"lat":51.7671248,"lng":55.0978517}}},{"Novokuznetsk":{"coords": {"lat":53.7575903,"lng":87.1358494}}},{"Ryazan":{"coords": {"lat":54.6295687,"lng":39.7425039}}},{"Tyumen":{"coords": {"lat":57.153534,"lng":65.542274}}},
],
},
{
"code": "CL",
"name": "chile",
"coords": {"lat":30, "lng":71 },
"cities": [ {"Gran Santiago":{"coords": {"lat":-33.4169275,"lng":-70.6067960975898}}},{"Gran Valparaiso":{"coords": {"lat":-33.7689627,"lng":-71.5776474}}},{"Gran Concepcion":{"coords": {"lat":14.6607071,"lng":121.1057609}}},{"Gran La Serena":{"coords": {"lat":-29.92636205,"lng":-71.27582876215479}}},{"Antofagasta":{"coords": {"lat":-23.6463741,"lng":-70.3980033}}},{"Gran Rancagua":{"coords": {"lat":-34.15137515,"lng":-70.71180642428769}}},{"Gran Puerto Montt":{"coords": {"lat":-41.5431615,"lng":-72.6071169}}},{"Talca":{"coords": {"lat":-35.4266305,"lng":-71.6661153}}},{"Arica":{"coords": {"lat":-18.4785288,"lng":-70.3211394}}},{"Gran Chillan":{"coords": {"lat":-36.90979015,"lng":-71.418528071109}}},{"Los Angeles":{"coords": {"lat":-37.4707455,"lng":-72.351686}}},{"Calama":{"coords": {"lat":-22.4623917,"lng":-68.9272181}}},{"Colina":{"coords": {"lat":-33.202472,"lng":-70.6749147}}},{"Gran Quillota":{"coords": {"lat":-32.8646227,"lng":-71.2260556}}},{"Valdivia":{"coords": {"lat":-39.8141262,"lng":-73.2459859}}},{"Osorno":{"coords": {"lat":-40.5732371,"lng":-73.1358145}}},{"Copiapo":{"coords": {"lat":-27.3664685,"lng":-70.3322753}}},{"Curico":{"coords": {"lat":-34.985368,"lng":-71.2393705}}},{"Melipilla":{"coords": {"lat":-33.6855134,"lng":-71.2145796}}},{"Punta Arenas":{"coords": {"lat":-53.1625688,"lng":-70.907822}}},{"Gran San Antonio":{"coords": {"lat":14.4806081,"lng":121.0368241}}},{"Lampa":{"coords": {"lat":-33.2895953,"lng":-70.8705255}}},{"Santiago":{"coords": {"lat":-33.4377756,"lng":-70.6504502}}},{"Ovalle":{"coords": {"lat":-30.6030819,"lng":-71.2029894}}},{"Penaflor":{"coords": {"lat":-33.6058638,"lng":-70.8785306}}},{"Linares":{"coords": {"lat":-35.8452905,"lng":-71.5977173}}},{"Paine":{"coords": {"lat":-33.8101102,"lng":-70.7390236}}},{"Los Andes-Calle Larga":{"coords": {"lat":-32.8252615,"lng":-70.6585479}}},{"San Felipe":{"coords": {"lat":-32.7506976,"lng":-70.7252018}}},{"Talagante":{"coords": {"lat":-33.6504376,"lng":-70.8984229}}},{"San Fernando":{"coords": {"lat":-34.583791,"lng":-70.989122}}},{"Buin":{"coords": {"lat":-33.7319741,"lng":-70.7419619}}},{"Rengo":{"coords": {"lat":-34.4088744,"lng":-70.8616583}}},{"Coyhaique":{"coords": {"lat":-45.5711804,"lng":-72.0684863}}},{"Villarrica":{"coords": {"lat":-39.2780911,"lng":-72.2274364}}},{"Vallenar":{"coords": {"lat":-28.5750438,"lng":-70.7616398}}},{"San Carlos":{"coords": {"lat":-36.4248192,"lng":-71.9581208}}},{"Angol":{"coords": {"lat":-37.798787,"lng":-72.7086097}}},{"San Vicente":{"coords": {"lat":-34.4392675,"lng":-71.07679}}},{"Molina":{"coords": {"lat":-35.1139703,"lng":-71.2799798}}},{"Limache":{"coords": {"lat":-33.0018741,"lng":-71.2657315}}},{"Constitucion":{"coords": {"lat":-35.3318306,"lng":-72.4118998}}},{"Cauquenes":{"coords": {"lat":-35.9671286,"lng":-72.315427}}},
],
},
]
}

and these is my vite.config file:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import imagemin from 'imagemin';
import imageminPngquant from 'imagemin-pngquant';
import imageminJpegtran from 'imagemin-jpegtran';
import imageminSvgo from 'imagemin-svgo';
import { terser } from 'rollup-plugin-terser';
import cssnano from 'cssnano';



// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
exclude: [/node_modules/],
babel: {
plugins: ['macros', '@emotion'],
},
}),
terser(),
cssnano(),

], resolve: {
alias: [
{ find: '@', replacement: path.resolve(__dirname, './src') },
],
},
build: {
// Agrega la tarea personalizada al evento `onEnd` de la construcción de producción
onEnd: async () => {
await imagemin(['src/assets/images/clinics*.{jpg,jpeg,png,svg}'], {
destination: 'build/images',
plugins: [
imageminPngquant(),
imageminJpegtran(),
imageminSvgo(),
],
});
}
}
})
Thank you


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (5)


Hi Niko Zen,

We checked your json and it seems like it is not valid, there is some excess curly brackets, try to recheck it and fix json to get rid of your the error.

Here is an example on how you can set server.hmr.overlay property.

server: {
hmr: {
overlay: false,
},
},


You can refer to https://vitejs.dev/config/server-options.html#server-hmr

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Ok, thank you very much... I will check it for the extra curly brackets, and try to add the lines to my vite.config. Thanks for take the time to answer my question.



I check the json, but I can find the extra curly brackets... I ask the GPT to and it can´t find it, but went y run the app y get these error
[plugin:vite:json] Failed to parse JSON file, invalid JSON syntax found at line 2083
Now itÅ› seems like that line doesn´t exist in the json file.



I find the extra curly brackets, in efect the cities names should be outside de {}

thank you.



Hi Niko Zen,

Glad to hear that. All the best with you project!

Please don't hesitate to reach out if you need anything more from us.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(