Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

267
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda