Won't work in now.sh - TypeError: Invalid query format.
Summary
When using massive inside a now.sh node program it fails to start, with error TypeError: Invalid query format.
After debugging it is caused by glob at https://gitlab.com/dmfay/massive-js/blob/master/lib/database.js#L231, if I run locally it finds the list of files if ran under now environment it fails to load them, however, using a readdirSync shows that they are there, my guess is that they are not being picked by glob
Example
Error Stack
TypeError: Invalid query format.
at Database.$query (/private/var/folders/1q/3nkn890x75qdj1nwrd73r70m0000gn/T/zeit-fun-8e3282e2062fd/node_modules/pg-promise/lib/query.js:60:17)
at Database.<anonymous> (/private/var/folders/1q/3nkn890x75qdj1nwrd73r70m0000gn/T/zeit-fun-8e3282e2062fd/node_modules/pg-promise/lib/query.js:259:23)
at /private/var/folders/1q/3nkn890x75qdj1nwrd73r70m0000gn/T/zeit-fun-8e3282e2062fd/node_modules/pg-promise/lib/database.js:326:42
at processTicksAndRejections (internal/process/task_queues.js:82:5)
at async Promise.all (index 1)
at async module.exports (/private/var/folders/1q/3nkn890x75qdj1nwrd73r70m0000gn/T/zeit-fun-8e3282e2062fd/config/manifest.js:36:21)
at async startServer (/private/var/folders/1q/3nkn890x75qdj1nwrd73r70m0000gn/T/zeit-fun-8e3282e2062fd/lib/index.js:11:34)
About to exit with code: 1
Code that causes that
await Massive({ connectionString: process.env.POSTGRES_URL });
Additional context
Also found by someone else at https://spectrum.chat/zeit/now/unable-to-connect-to-postgres-db~3c226373-95fa-4ce9-8d88-cef2edc957d7
Edited by David Roncancio