#Imported function is undefined in a dynamic route

8 messages · Page 1 of 1 (latest)

digital pilot
#

So I am trying to import this function from my api routes which is supposed to build my data path and then extract it but the imported files are rendered undefined and throws an error saying the function doesnt exist.

scenic tinselBOT
#

🔎 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)
digital pilot
#

These are the functions I am exporting

#

I am importing them here in a dynamic route [employeeId]

#

I am calling those functions in a getServerSideProps function

#

I commented that code that was giving me error, then re ran the development and it started throwing the error that 'fs' cant be resolved, probably because fs is only allowed server side, then I remove the comments to resolve this and it started working

#

I dont get it but it works now this_is_fine