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

Cloudflare Workers #55

Closed
Atashik opened this issue Nov 24, 2024 · 2 comments
Closed

Cloudflare Workers #55

Atashik opened this issue Nov 24, 2024 · 2 comments

Comments

@Atashik
Copy link

Atashik commented Nov 24, 2024

Need a version without Deno support:

npx wrangler deploy

⛅️ wrangler 3.90.0

Total Upload: 724.11 KiB / gzip: 114.80 KiB

X [ERROR] A request to the Cloudflare API (/accounts/0d969c14a060ee9242ee242924c962fc/workers/scripts/fruitslots/versions) failed.

Uncaught ReferenceError: __dirname is not defined
at null.
(file:///C:/Cludflare/fruitslots/node_modules/@deno/shim-deno/dist/deno/stable/variables/mainModule.js:8:173)
in node_modules/@deno/shim-deno/dist/deno/stable/variables/mainModule.js
at null. (index.js:32:50) in __require2
at null.
(file:///C:/Cludflare/fruitslots/node_modules/@deno/shim-deno/dist/deno/stable/variables.js:37:23)
in node_modules/@deno/shim-deno/dist/deno/stable/variables.js
at null. (index.js:32:50) in __require2
at null.
(file:///C:/Cludflare/fruitslots/node_modules/@deno/shim-deno/dist/deno/stable/functions.js:10:24)
in node_modules/@deno/shim-deno/dist/deno/stable/functions.js
at null. (index.js:32:50) in __require2
at null.
(file:///C:/Cludflare/fruitslots/node_modules/@deno/shim-deno/dist/deno/stable/main.js:19:14) in
node_modules/@deno/shim-deno/dist/deno/stable/main.js
at null. (index.js:32:50) in __require2
at null.
(file:///C:/Cludflare/fruitslots/node_modules/@deno/shim-deno/dist/deno.js:17:14) in
node_modules/@deno/shim-deno/dist/deno.js
at null. (index.js:32:50) in __require2
[code: 10021]

@KnorpelSenf
Copy link
Member

This is caused by Node support. You actually need to use the Deno version instead. This requires a new build process which we are going to introduce to all plugins anyway. It will take some time.

Until then, you can download a bundle of this library. You can get it here: https://bundle.deno.dev/https://raw.githubusercontent.com/grammyjs/i18n/refs/heads/main/src/mod.ts

This file needs to be copied into your project. There's no type safety. It's just a temporary workaround until the build system was changed.

I will close this in favour of grammyjs/grammY#559.

@Atashik
Copy link
Author

Atashik commented Nov 25, 2024

Temp workaround for me:
Delete @deno folder from node_modules and package.json dependencies
and comment out all code in _dnt.shims.js
Coz don't wanna harden my project with heavy unnecessary extra large code-base.
Cloudflare workers count every extra ram and cpu usage.
Thank You for file You sent but it miss I18nFlavor so i decide to go this way.

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

2 participants