fastn-stack / fastn

🚧 (Alpha stage software) fastn - better way to build websites 🚧
https://fastn.com
GNU Affero General Public License v3.0
464 stars 36 forks source link

Conflict b/w module parameter name and file name #1776

Open Arpita-Jaiswal opened 7 months ago

Arpita-Jaiswal commented 7 months ago

Consider a file pages/create-site.ftd

-- import: <package-name>/actions/create-site

-- component page:
module create-site: create-site

...
-- ftd.text: $page.create-site.site-error
...

-- end: page

This throw error saying <package-name>/pages/create-site/#site-error not found. So fastn is trying to fetch the site-error variable from pages/create-site.ftd instead of actions/create-site.ftd.

Workaround is to change the name of one of the document. Like if actions/create-site.ftd is renamed to actions/create-site-action.ftd it worked.

Now pages/create-site.ftd changed to

-- import: <package-name>/actions/create-site-action

-- component page:
module create-site: create-site-action

...
-- ftd.text: $page.create-site.site-error
...

-- end: page

Checkout https://github.com/FifthTry/ui/commit/7df7494af7d9b50d31acb2681690b6d0ac89910a