Back
PathNotFoundException: Cannot open file, path = 'file:///usr/local/server/src/static/index.html
- 0
- Self Hosted
- Functions
Shiba
TypeScript
PathNotFoundException: Cannot open file, path = 'file:///usr/local/server/src/static/wellcome.html' (OS Error: No such file or directory, errno = 2)
#0 _File.throwIfError (dart:io/file_impl.dart:675)
#1 _File.openSync (dart:io/file_impl.dart:490)
#2 _File.readAsBytesSync (dart:io/file_impl.dart:574)
#3 _File.readAsStringSync (dart:io/file_impl.dart:624)
#4 getStaticFile (package:starter_template/utils.dart:23)
#5 main (package:starter_template/main.dart:29)
<asynchronous suspension>
#6 Future.any.onValue (dart:async/future.dart:615)
<asynchronous suspension>
in Function code ------->
TypeScript
main(){
final String _dirname = Platform.script.toFilePath();
final String staticFolder = '${Uri.file(_dirname).resolve('../static')}';
String getStaticFile(String fileName) {
return File('$staticFolder/$fileName').readAsStringSync();
}
final String htmlFile = getStaticFile('wellcome.html');
}
TL;DR
Developers are encountering a PathNotFoundException because the file 'wellcome.html' cannot be found in the specified path. The issue is likely due to a misspelling of 'welcome.html'. The solution is to correct the filename in the code to 'welcome.html' to match the actual file name. Recommended threads
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...
- Create admin user?
I'm not really sure how this is supposed to work, I installed Appwrite through docker-compose and set it up. When I launched the app and went into it, I created...