S3ppo
i tried to upgrade my old functions, but i now i get this error:
TypeScript
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/code-start/src/main.js
require() of ES modules is not supported.
require() of /usr/code-start/src/main.js from /usr/local/src/server.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename main.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /usr/code-start/package.json.
at new NodeError (node:internal/errors:363:5)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1125:13)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Function.Module._load (node:internal/modules/cjs/loader:828:14)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39)
at require (node:internal/modules/cjs/helpers:93:18)
at /usr/local/src/server.js:55:28
at processTicksAndRejections (node:internal/process/task_queues:96:5)
anybody knows what to do?
TL;DR
Developers are encountering an error when trying to upgrade old functions. The issue is related to ES modules and the error message suggests possible solutions such as renaming the file to end in .cjs, changing the requiring code to use import(), or removing "type": "module" from the package.json file. Recommended threads
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...
- Create admin user?
I'm not really sure how this is supposed to work, I installed Appwrite through docker-compose and set it up. When I launched the app and went into it, I created...