Back

[SOLVED] appwrite function cannot use import statement outside a module

  • 0
  • Functions
  • Cloud
ianmont
29 Sep, 2023, 22:14

I'm getting this error when executing my function, I know it says that the Stripe import cannot go outside the function, however in the appwrite documentation there is an example of a function that imports a dependency outside of all the code.

what im doing wrong?

TL;DR
The user was getting an error stating that the appwrite function cannot use the import statement outside a module. They were unsure of what they were doing wrong. The solution suggested by Steven was to check if the "type" in the package.json file was set to "module". This fixed the issue and solved the problem.
Drake
29 Sep, 2023, 23:21

in your package.json, do you have type set to module?

ianmont
29 Sep, 2023, 23:59

thanks Steven, I think it was that

Drake
30 Sep, 2023, 00:08

[SOLVED] appwrite function cannot use import statement outside a module

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more