2
0
Fork
You've already forked cms
0

fix: replace import with fetch to appease denodeploy #76

Merged
esroyo merged 1 commit from fix/fetch-locale into main 2026年05月02日 10:47:59 +02:00
esroyo commented 2026年05月02日 00:07:01 +02:00 (Migrated from github.com)
Copy link

On one hand, Deno Deploy's runtime is strictly forbidden from downloading new modules over the network while the app is actively running. On the other, It can't analyze a dynamic import with a variable string during the build and deployment phase. In the end, it does not download the JSON files into the deployment bundle, and we end-up with an error:

TypeError: Module not found
 at async setLocale (https://cdn.jsdelivr.net/gh/esroyo/cms@eaf17bd/static/common/locale.js:4:32)
 at async https://cdn.jsdelivr.net/gh/esroyo/cms@eaf17bd/core/routes/main.ts:80:7
 at async Router.#runHandler (https://deno.land/x/galo@v0.3.4/mod.ts:437:24)
 at async Router.#runRouter (https://deno.land/x/galo@v0.3.4/mod.ts:372:14)
 at async mapped (ext:deno_http/00_serve.ts:407:18) {
 code: "ERR_MODULE_NOT_FOUND"
}

@oscarotero would you mind replacing the beautiful locales dynamic import() with a nasty fetch? 😓

On one hand, Deno Deploy's runtime is strictly forbidden from downloading new modules over the network while the app is actively running. On the other, It can't analyze a dynamic import with a variable string during the build and deployment phase. In the end, it does not download the JSON files into the deployment bundle, and we end-up with an error: ``` TypeError: Module not found at async setLocale (https://cdn.jsdelivr.net/gh/esroyo/cms@eaf17bd/static/common/locale.js:4:32) at async https://cdn.jsdelivr.net/gh/esroyo/cms@eaf17bd/core/routes/main.ts:80:7 at async Router.#runHandler (https://deno.land/x/galo@v0.3.4/mod.ts:437:24) at async Router.#runRouter (https://deno.land/x/galo@v0.3.4/mod.ts:372:14) at async mapped (ext:deno_http/00_serve.ts:407:18) { code: "ERR_MODULE_NOT_FOUND" } ``` @oscarotero would you mind replacing the beautiful locales dynamic `import()` with a nasty `fetch`? :sweat:

No problem.
Out of curiosity, are you using the new Deno deploy or the classic one?

No problem. Out of curiosity, are you using the new Deno deploy or the classic one?
esroyo commented 2026年05月02日 11:18:42 +02:00 (Migrated from github.com)
Copy link

Thanks @oscarotero ❤️
I'm still using the classic one. I don't know if the new one will have similar limitations.

Thanks @oscarotero :heart: I'm still using the classic one. I don't know if the new one will have similar limitations.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lume/cms!76
Reference in a new issue
lume/cms
No description provided.
Delete branch "fix/fetch-locale"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?