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

142
Visualizações
Shopify Server not allowing complete file download

I have coded a page using webpack and integrated it into a shopify store. The site is working fine on my local server, but not on the shopify servers.

The problem is due to this part: 

  return fetch(filePath)
// Retrieve its body as ReadableStream
.then(response => response.body)
// Create a gray-scaled PNG stream out of the original
.then(rs => {
  console.log(rs)
  return rs.pipeThrough(
    new TransformStream({
      transform: async (chunk, controller) => {
        try {
          const decryptedChunk = decipher.update(chunk)
          controller.enqueue(decryptedChunk)
        } catch (err) {
          console.error(err)
        }
      }
    })
  )
})
// Create a new response out of the stream
.then(rs => new Response(rs))
// Create an object URL for the response
.then(response => response.blob())
.then(blob => URL.createObjectURL(blob))
// return the URL
.then((responseURL) => { return responseURL })
.catch(console.error)

It is working fine one my local 'Windows 10' computer with shopify theme serve. Four chunks are loaded per target file. It was also working fine in the previous site version on a CentOS 7 server.

When push the page to the shopify server, the target file is not completely loaded. Only one fragmented chunk is loaded and that is all.

I have tried with Brave, Chrome, Firefox and Edge. All the same results. It seems that fetch does not download the complete file.

UPDATE: The url is computed dynamically by shopify, something like '"https://cdn.shopify.com/s/files/1/0592/8421/4512/t/1/assets/42a0ee4e462cc7ac412522343.zip"

Locally, the file is correctly loaded using a fetch, and can be downloaded directly from the browser using the provided link.

On the shopify server, the fetch is not working. When I try a direct download from the browser, it returns a 1ko file (instead of ~100ko) with the correct name.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Shopify can only serve files in the following format:

JS CSS GIF JPG PNG JSON CSV PDF (<20Mo)

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