zsmooth
zsmooth
CDCloudflare Developers
Created by Magnum🅱 on 10/1/2024 in #pages-help
Deployment failed! Got error: Your Worker exceeded the size limit of 1 MiB
npm run build will tell you exactly how big your worker is
6 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
{
"include": [
"worker-configuration.d.ts",
"remix.env.d.ts",
"env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@remix-run/cloudflare", "@cloudflare/workers-types"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
},
// Remix takes care of building everything in `remix build`.
"noEmit": true
}
}
{
"include": [
"worker-configuration.d.ts",
"remix.env.d.ts",
"env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@remix-run/cloudflare", "@cloudflare/workers-types"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
},
// Remix takes care of building everything in `remix build`.
"noEmit": true
}
}
10 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
never mind, still doesn't work
10 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
i think since it comes after the worker-configuration in my tsconfig, it loads after and augments Env with the correct type
10 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
for now, i just added a env.d.ts file, and put this in it:
declare global {
interface Env {
CHATSTORE: DurableObjectNamespace<
import("./app/durable_objects/chat_store").ChatStore
>;
}
}
declare global {
interface Env {
CHATSTORE: DurableObjectNamespace<
import("./app/durable_objects/chat_store").ChatStore
>;
}
}
10 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
also, this is include from my tsconfig:
"include": [
"worker-configuration.d.ts",
"remix.env.d.ts",
"env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"include": [
"worker-configuration.d.ts",
"remix.env.d.ts",
"env.d.ts",
"**/*.ts",
"**/*.tsx"
],
10 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
if i manually change it to:
CHATSTORE: DurableObjectNamespace<
import("./app/durable_objects/chat_store").ChatStore
>;
CHATSTORE: DurableObjectNamespace<
import("./app/durable_objects/chat_store").ChatStore
>;
then it works, but this file is automatically generated, and the next time i run wrangler types it would get blown away
10 replies
CDCloudflare Developers
Created by zsmooth on 10/2/2024 in #workers-help
DurableObjectNamespace losing its type?
It's in my project root. (I'm in a remix app). The ./build/index path is correct relative to the file
10 replies
CDCloudflare Developers
Created by Brod on 9/6/2024 in #workers-help
ERROR Could not resolve "cloudflare:workers"
eslint doesn't know how to resolve cloudflare:workers, so it complains about import { DurableObject } from "cloudflare:workers";. I just shut it off though and things seem to work fine:
// eslint-disable-next-line import/no-unresolved
import { DurableObject } from "cloudflare:workers";
// eslint-disable-next-line import/no-unresolved
import { DurableObject } from "cloudflare:workers";
6 replies
CDCloudflare Developers
Created by Brod on 9/6/2024 in #workers-help
ERROR Could not resolve "cloudflare:workers"
How do we satisfy eslint with this import? Is there a cloudflare template that has eslint set up that demonstrates?
6 replies