#How do you create utility function files with no default export

4 messages · Page 1 of 1 (latest)

tranquil finch
#

I'm building my app locally and am running into an issue where the compiler complains about a file not having a default export. I managed to solve the issue in one of them by simply adding default

export default ()=>{
//...
}```

My `nodemailer.ts` is completely blank. Do I still need an `export default`? Do I just do a simple 
```tsx
export default {}

for the compiler to stop complaining? Is this a good work around?

rain hazelBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

calm hazel
#

You should only add files that are expected to be pages in the pages directory, everything else should be outside otherwise Next will try to create a routable page to the file

tranquil finch
#

I thought it would be good practice to place lib folders alongside components, but I guess how NextJS is implemented is to create paths like you mentioned if they're in the pages directory.