Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
SvelteKit build (w/ adapter-node) 404 on newly created static files

Using @sveltejs/adapter-node: 1.0.0-next.61 and @sveltejs/kit: ^1.0.0-next.225

The following issue occurs only on the build version of the app, and not on the dev server, on which it doesn't occur.

When uploading a new file, my app keeps returning 404 regarding those newly created files as though the app is blind to those. Interestingly enough, said images are found when restarting the server.

The creation request succeeds: POST REQUEST 200

The file is correctly created on the filesystem and should be loaded by the page as seen in the json response which lists all files to be loaded on the page: file exists

However, when attempting to fetch the file, the server responds with a 404 although the path to it is correct: 404

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Actually I found two solutions but both are just workarounds to this very annoying problem.

  • The import way: that's quite tricky to configure it properly (read also this) and, overall, it becomes a pain if you need to import dynamic paths (with variables inside the import path) as it was in my case.

  • The CDN way: use the static folder as a CDN by pointing there the webserver with a dedicated (sub)domain. This way you can link assets with success as they are "external" resources (e.g. https://cdn.mysite.com/file1.png, https://cdn.mysite.com/file2.jpg).

Bonus: if you choose the CDN workaround, can be a good idea to set Externalfetch to bypass the external DNS resolution and keeping traffic internally.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!