You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running my grammy telegram bot on CFW (Cloudflare Workers) and I would like to use the @grammyjs/conversations plugin. However this plugin has an indirect dependency to @deno/shim-deno though o-son.
This dependency leads to errors at build time.
// ...constbot=newBot(token)bot.use(conversations());// This line causes the error// ...
When I try to deploy my bot with wrangler deploy (or to run it locally with wrangler dev), I have this error:
...
✘ [ERROR] Could not resolve "fs"
node_modules/.pnpm/[email protected]/node_modules/isexe/windows.js:4:17:
4 │ var fs = require('fs')
╵ ~~~~
The package "fs" wasn't found on the file system but is built into node.
Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.
✘ [ERROR] Could not resolve "util"
node_modules/.pnpm/[email protected]/node_modules/o-son/script/_dnt.shims.js:7:23:
7 │ const util_1 = require("util");
╵ ~~~~~~
The package "util" wasn't found on the file system but is built into node.
Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.
✘ [ERROR] Could not resolve "path"
node_modules/.pnpm/[email protected]/node_modules/which/which.js:5:21:
5 │ const path = require('path')
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node.
Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.
✘ [ERROR] Build failed with 108 errors:
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/internal/Conn.js:17:22: ERROR: Could not resolve "net"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/internal/fs_flags.js:33:21: ERROR: Could not resolve "fs"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/internal/fs_flags.js:34:37: ERROR: Could not resolve "os"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/classes/FsFile.js:28:32: ERROR: Could not resolve "fs"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/classes/PermissionStatus.js:9:102: ERROR: Could not resolve "events"
I only tail 3 of the 108 errors, but they all refer to an "Could not resolve" error. The unresolved libs are the following:
"path"
"utils"
"util"
"fs"
"fs/promises"
"os"
"url"
"process"
"net"
"events"
"child_process"
"dns"
"tls"
"tty"
They are mostly in the @deno/shim-deno package (103 out of 108) but also 3 in isexe ("fs"), 1 in o-son ("util" without s) and 1 in which ("path")
Of course, I've tried to add node_compat = true in the wrangler.toml and the output is the following:
...
✘ [ERROR] Could not resolve "fs/promises"
node_modules/.pnpm/@[email protected]/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/.pnpm/@[email protected]/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/.pnpm/@[email protected]/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/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmod.js:28:32:
ERROR: Could not resolve "fs/promises"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/functions/chown.js:28:32:
ERROR: Could not resolve "fs/promises"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFile.js:31:32:
ERROR: Could not resolve "fs/promises"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/functions/link.js:28:32:
ERROR: Could not resolve "fs/promises"
node_modules/.pnpm/@[email protected]/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstat.js:31:32:
ERROR: Could not resolve "fs/promises"
Once again I only tail 3 of the 20 errors, but as you can see, only the : "fs/promises" package leads to an error now and all the other errors are gone. And all the 20 errors are in the @deno/shim-deno package.
Of course I don't need to use "fs" for my use case, because I use the @grammyjs/storage-supabase for the storage and we don't have access to the file system in the CFW environment anyway.
My question is: will you plan to support the CFW environment for this plugin? If not, is there some workaround we can implement to bypass this issue?
Thank you for your time!
The text was updated successfully, but these errors were encountered:
Yes. As a temporary workaround, you can use tools like https://bundle.deno.dev/ and pass the raw source code URL from GitHub to it in order to obtain a web build. Or perhaps @PonomareVlad has created such a build? I'm not entirely sure.
Hi!
I'm running my grammy telegram bot on CFW (Cloudflare Workers) and I would like to use the
@grammyjs/conversations
plugin. However this plugin has an indirect dependency to@deno/shim-deno
thougho-son
.This dependency leads to errors at build time.
When I try to deploy my bot with
wrangler deploy
(or to run it locally withwrangler dev
), I have this error:I only tail 3 of the 108 errors, but they all refer to an "Could not resolve" error. The unresolved libs are the following:
They are mostly in the
@deno/shim-deno
package (103 out of 108) but also 3 inisexe
("fs"), 1 ino-son
("util" without s) and 1 inwhich
("path")Of course, I've tried to add
node_compat = true
in the wrangler.toml and the output is the following:Once again I only tail 3 of the 20 errors, but as you can see, only the : "fs/promises" package leads to an error now and all the other errors are gone. And all the 20 errors are in the
@deno/shim-deno
package.Of course I don't need to use "fs" for my use case, because I use the
@grammyjs/storage-supabase
for the storage and we don't have access to the file system in the CFW environment anyway.My question is: will you plan to support the CFW environment for this plugin? If not, is there some workaround we can implement to bypass this issue?
Thank you for your time!
The text was updated successfully, but these errors were encountered: