I can't fix [Cannot find file] :(

import SwiftUI

class MoneyViewModel: ObservableObject {
@Published var consumptionDetails: String = ""
let moneyJson = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent("money.json")
init(moneyJson: URL) {
loadConsumptionDetails(from: moneyJson)
}

func loadConsumptionDetails(from moneyJson: URL) {
    do {
        let data = try Data(contentsOf: moneyJson)
        if let details = String(data: data, encoding: .utf8) {
            consumptionDetails = details
            print("Loaded consumption details: \(details)")
        } else {
            print("Failed to decode consumption details")
        }
    } catch let error as NSError {
        if error.code == NSFileReadNoSuchFileError {
            print("The file 'money.json' does not exist.")
        } else {
            print("Error loading consumption details: \(error)")
        }
    }
}

}

struct MoneyView: View {
@StateObject private var viewModel: MoneyViewModel

init() {
    let moneyJson = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent("money.json")
    _viewModel = StateObject(wrappedValue: MoneyViewModel(moneyJson: moneyJson))
}

var body: some View {
    ScrollView {
        Text(viewModel.consumptionDetails)
            .font(.headline)
            .padding()
    }
}

}

struct MoneyView_Previews: PreviewProvider {
static var previews: some View {
MoneyView()
}
}

I very sure money.json is exist
But I don't know How to do fix that
(save system is work it)

Please fix the code formatting, this is difficult to read.

Are you running this on a Mac or on a iOS simulator or device? If on simulator, then double check the file is on Documents directory of the simulator, not in the Mac Documents directory.