Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

268
Vistas
front slash changes to back slash after #

Hello I am doing this electron project and I came across this issue where when I give this path

`file://${path.join(__dirname, `../build/index.html#/view/${arg}`)}`

I was hoping for this,

file:///C:/Users/admin/AppData/Local/Programs/electrondesktop/resources/app.asar/build/index.html#/view/61995a6fcf31f7cddedcce59

Instead, I get,

file:///C:/Users/admin/AppData/Local/Programs/electrondesktop/resources/app.asar/build/index.html#\view\61995a6fcf31f7cddedcce59

Notice how the forward-slash("/") changes to back-slash("\") after the hash(#) symbol

index.html#/view/61995a6fcf31f7cddedcce59

index.html#\view\61995a6fcf31f7cddedcce59

How do I fix this?

I'm using electron with react btw.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Figured out the Answer!

Apparently, there is another way to avoid slashes after #

Its something like this,

url.format({
         pathname: path.join(__dirname,`index.html`),
         protocol:'file',
         slashes:true,
         hash:`#/view/61995a6fcf31f7cddedcce59`
       })

__dirname gives the path I needed. i.e. file:///C:/Users/admin/AppData/Local/Programs/electrondesktop/resources/app.asar/build/

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda