hummingbird-project / hummingbird-examples

Examples demonstrating various aspects of the Hummingbird swift server framework
Apache License 2.0
90 stars 19 forks source link

todos-auth-fluent crashes on launch #113

Closed mredig closed 2 months ago

mredig commented 2 months ago

It crashes on this line: image

So, I set my working directory to /path/to/hummingbird-examples/todos-auth-fluent and proceeded to get the same crash.

image

I'm not familiar with how Mustache works, but I assume there's supposed to be a file or folder matching the expectation?

Here's the directory contents from a fresh checkout:

arm64 mredig@mba2020 todos-auth-fluent % ls -l
total 24
-rw-r--r--  1 mredig  staff  3054 Sep 23 02:15 Dockerfile
-rw-r--r--@ 1 mredig  staff  2505 Sep 23 21:00 Package.swift
-rw-r--r--@ 1 mredig  staff   709 Sep 23 02:15 README.md
drwxr-xr-x  3 mredig  staff    96 Jul 14  2023 Sources
drwxr-xr-x  3 mredig  staff    96 Jul 14  2023 Tests
drwxr-xr-x  5 mredig  staff   160 Sep 23 02:15 public
mredig commented 2 months ago

Interesting - it appears if I run via cli, it works...

adam-fowler commented 2 months ago

This has nothing to do with mustache. It is related to bundling assets with modules. I assumed they worked in Xcode as they work from the CLI, which is used by VSCode. I'll investigate. The error message at least is misleading as the working directory won't affect it.

mredig commented 2 months ago

It it affects your priorities at all, think of it simply as a bug report "just so you know". It's not affecting my ability to get my work done, so no pressure from me to fix it! (Unless you want moral support, then by all means GET ON IT!) :)

adam-fowler commented 2 months ago

It's related to how SwiftPM and Xcode bundle assets. SwiftPM places them all in the root folder of the bundle and Xcode places them in a Contents/Assets folder.

adam-fowler commented 2 months ago

I should be using resoucesPath instead of bundlePath I'll fix it

adam-fowler commented 2 months ago

114 will fix this