Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't deploy conversations plugin on Cloudflare Workers #564

Closed
Nesquik opened this issue May 3, 2024 · 1 comment
Closed

Can't deploy conversations plugin on Cloudflare Workers #564

Nesquik opened this issue May 3, 2024 · 1 comment

Comments

@Nesquik
Copy link

Nesquik commented May 3, 2024

Hi there, I'm getting the following error while trying to build a bot on Cloudflare after having installed the conversations plugin:

✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/chmod.js:28:32:
      28 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/chown.js:28:32:
      28 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFile.js:31:32:
      31 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/link.js:28:32:
      28 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/lstat.js:31:32:
      31 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDir.js:5:27:
      5 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdir.js:8:27:
      8 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/readDir.js:8:27:
      8 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/readFile.js:8:27:
      8 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/readLink.js:28:32:
      28 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFile.js:8:27:
      8 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/realPath.js:28:32:
      28 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/remove.js:5:27:
      5 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/rename.js:5:27:
      5 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/stat.js:8:27:
      8 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/symlink.js:28:32:
      28 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/truncate.js:31:32:
      31 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/watchFs.js:5:27:
      5 │ const promises_1 = require("fs/promises");
        ╵                            ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFile.js:31:32:
      31 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Could not resolve "fs/promises"

    node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFile.js:31:32:
      31 │ const fs = __importStar(require("fs/promises"));
         ╵                                 ~~~~~~~~~~~~~

  The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.


✘ [ERROR] Build failed with 20 errors:

  node_modules/@deno/shim-deno/dist/deno/stable/functions/chmod.js:28:32: ERROR: Could not
  resolve "fs/promises"
  node_modules/@deno/shim-deno/dist/deno/stable/functions/chown.js:28:32: ERROR: Could not
  resolve "fs/promises"
  node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFile.js:31:32: ERROR: Could not
  resolve "fs/promises"
  node_modules/@deno/shim-deno/dist/deno/stable/functions/link.js:28:32: ERROR: Could not
  resolve "fs/promises"
  node_modules/@deno/shim-deno/dist/deno/stable/functions/lstat.js:31:32: ERROR: Could not
  resolve "fs/promises"
  ...

My package.json dependencies:

  "dependencies": {
    "@grammyjs/conversations": "^1.2.0",
    "@grammyjs/menu": "^1.2.1",
    "@grammyjs/storage-cloudflare": "^2.4.2",
    "dotenv": "^16.4.5",
    "drizzle-orm": "^0.30.10",
    "grammy": "^1.22.4",
  },
  "devDependencies": {
    "@cloudflare/workers-types": "^4.20240423.0",
    "@types/node": "^20.12.8",
    "drizzle-kit": "^0.20.17",
    "typescript": "^5.4.5",
    "wrangler": "3.53.0"
  }

From the looks of it o-son has @deno/shim-deno as a dependency and it all breaks down from there.

My wrangler.toml already has the node_compat = true and compatibility_date = "2023-01-16" like noted here: https://grammy.dev/hosting/cloudflare-workers-nodejs

Any hints on how to approach this would be very appreciated, thanks.

@Nesquik Nesquik closed this as completed May 3, 2024
@Nesquik
Copy link
Author

Nesquik commented May 3, 2024

Sorry, reopened here: grammyjs/conversations#104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant