deploy sveltekit: nixpacks stream did not contain valid UTF-8
Hi,
I deploy my sveltekit project but I have the error below. What is the issue please?
Error logs:
==============
Using Nixpacks
==============
context: 9eac5891d93a9179fe251a2d7a841575
Nixpacks build failed
Error: Error reading static/js/bootstrap.bundle.min.js
Caused by:
stream did not contain valid UTF-8
10 Replies
Project ID:
d7afdbc4-93fd-4b7a-bcd8-87fffb54273f
⚠️ experimental feature
d7afdbc4-93fd-4b7a-bcd8-87fffb54273f
Caused by:
stream did not contain valid UTF-8
check the encoding of that file
I will have to encode all my files in utf 8?
It works well localy
yes everything should be utf-8
^
open the file and save it as utf8
oops
discord moment
the chat was empty when i typed that
I created a c# script to bulkconvert my js files
try
{
string[] files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
foreach (var file in files)
{
string text = File.ReadAllText(file);
Encoding encoding = Encoding.UTF8;
Console.WriteLine("Encoding: {0}", encoding.EncodingName);
StreamWriter streamWriter = new StreamWriter(file, false, encoding);
streamWriter.Write(text);
streamWriter.Close();
Console.WriteLine("Encoding: {0}", encoding.EncodingName);
Console.WriteLine();
Console.WriteLine();
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.WriteLine("Bye!");
I'd be interested to know why your files weren't utf-8 to begin with?