wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.63k stars 1.18k forks source link

Explain in docs how to import JSON files / read static files in Wasp on the server #1564

Open Martinsos opened 11 months ago

Martinsos commented 11 months ago

Right now it is a bit tricky because you can't directly import .json with node (at least 18), and people get surprised with it because error message is confusing (claims there is no file).

I explained how to go about it here: https://discord.com/channels/686873244791210014/1171780998699171841/1171780998699171841 .

We could add a small section in docs that covers this, since we had multiple people ask about this so far, even if it is not really Wasp-specific issue.

Martinsos commented 7 months ago

Another user asking about this: https://discord.com/channels/686873244791210014/1218225782183170158/1218225782183170158 .

Martinsos commented 1 week ago

Another ask on discord: https://discord.com/channels/686873244791210014/1293199953719459881/1293199953719459881 .

Is it possible to read a local file in a query implementation defined in operations.ts ?