question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Functions filenames fail if they don't match exactly the filename

See original GitHub issue

Might be intentional, but it is a difference between v1 and v2, when calling a function (e.g. functions/hello.js), if the cases are not exactly matching then the function fails. In v1, even if the filename was written in camelCase and the function was called with all lower letters (like a web url) the function was still executed. In v2, it gives a 404 and file not found error.

Reproduce:

  1. Following the docs, create a functions/hello.js file, then rename it to helLo.js.
  2. Try calling the function with const { res, error } = await nhost.functions.call('/hello', { name: 'Johan' })
  3. See the 404 response

Expected outcome: The function should still be called

Thoughts: I would prefer to have the same handling as in v1 here, as I can’t think of any time when one needs to separate between two files based on capital letters. V1 also provided more flexibility in naming conventions on the backend (e.g. camelcase was possible)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
elitancommented, Jan 19, 2022
0reactions
Svartocommented, Jan 19, 2022

This is intentional. URLs and files are case-sensitive. However, I would recommend keeping all function file names to lowercase.

Fair enough that it is intentional.

Just a comment, URLs are not case sensitive for the user. Try write in GoOgle.com in your browser and you’ll still be directed to google.com. Same with if you try and capitalize a article url on e.g. theverge.com

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reading a file without mentioning its specific file name in R
Maybe a better approach would be to read all file names in the directory, find the match, and then read that complete name....
Read more >
File Name Functions (GNU make)
The argument of the function is regarded as a series of file names, separated by whitespace. (Leading and trailing whitespace is ignored.) Each...
Read more >
How to fake a script file name inside a monolithic vimrc?
You can be sure that if two different files have a s:foo variable and a s:bar() function, they are certainly used for totally...
Read more >
Error message when you open or save a file in Microsoft Excel
This error message occurs when you save or open a file if the path to the file (including the file name) exceeds 218...
Read more >
Function FileFindFirstFile - AutoIt
Due to the underlying Windows API used (FindFirstFile), this function actually searches both the long and short filenames when looking for matches. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found