templates
Public

Templates for Cloudflare Workers

๐Ÿ› BUG:new_classes Should Be new_sqlite_classes for Free Plan Compatibility#459

Open
Opened 4/23/20250 commentsby knowlet
knowlet

### Which template does this pertain to? multiplayer-globe-template ### What versions are you using? 4.7.0 [Wrangler], 22.9.0 [Node.js] ### What operating system and version are you using? Mac Sequoia 15.4.1 (24E263) ### Please provide a link to a minimal reproduction (optional) https://gitlab.com/knowlet/multiplayer-globe ### Describe the Bug Cloudflare Durable Objects are available on both Workers Free and Workers Paid plans. However, when using the Workers Free plan, only Durable Objects that use the [SQLite storage backend](https://developers.cloudflare.com/durable-objects/best-practices/access-durable-objects-storage/#wrangler-configuration-for-sqlite-backed-durable-objects) are supported. To ensure compatibility with the Free plan, we must create Durable Objects namespace using the `new_sqlite_classes` migration. Otherwise, it may encounter the following error: > In order to use Durable Objects with a free plan, we must create a namespace using a `new_sqlite_classes` migration. [code: 10097] Reference: โ€ข [Durable Objects storage limits](https://developers.cloudflare.com/durable-objects/platform/limits/#key-value-backed-durable-objects-general-limits) Suggested Fix In the [multiplayer-globe-template](https://github.com/cloudflare/templates/tree/8797403a61cb264f662b53b3d5f50bf571c11a2b/multiplayer-globe-template), the wrangler.json file currently uses: ``` "migrations": [ { "new_classes": ["Globe"], "tag": "v1" } ], ``` For compatibility with the Free plan, this should be updated to: ``` "migrations": [ { "new_sqlite_classes": ["Globe"], "tag": "v1" } ], ``` File: [wrangler.json (line 7)](https://github.com/cloudflare/templates/blob/8797403a61cb264f662b53b3d5f50bf571c11a2b/multiplayer-globe-template/wrangler.json#L7) ### Please provide any relevant error logs ``` 2025-04-23T02:13:57.262Z Initializing build environment... 2025-04-23T02:14:03.913Z Success: Finished initializing build environment 2025-04-23T02:14:04.650Z Cloning repository... 2025-04-23T02:14:06.121Z Detected the following tools from environment: [email protected], [email protected] 2025-04-23T02:14:06.124Z Restoring from dependencies cache 2025-04-23T02:14:06.128Z Restoring from build output cache 2025-04-23T02:14:06.562Z Installing project dependencies: npm clean-install --progress=false 2025-04-23T02:14:15.407Z 2025-04-23T02:14:15.408Z added 71 packages, and audited 72 packages in 8s 2025-04-23T02:14:15.408Z 2025-04-23T02:14:15.408Z 8 packages are looking for funding 2025-04-23T02:14:15.409Z run `npm fund` for details 2025-04-23T02:14:15.477Z 2025-04-23T02:14:15.477Z 5 vulnerabilities (3 low, 2 moderate) 2025-04-23T02:14:15.477Z 2025-04-23T02:14:15.479Z To address all issues, run: 2025-04-23T02:14:15.479Z npm audit fix --force 2025-04-23T02:14:15.479Z 2025-04-23T02:14:15.479Z Run `npm audit` for details. 2025-04-23T02:14:15.504Z Executing user deploy command: npm run deploy 2025-04-23T02:14:15.752Z 2025-04-23T02:14:15.752Z > deploy 2025-04-23T02:14:15.752Z > wrangler deploy 2025-04-23T02:14:15.752Z 2025-04-23T02:14:16.788Z 2025-04-23T02:14:16.788Z โ›…๏ธ wrangler 4.7.0 (update available 4.12.1) 2025-04-23T02:14:16.789Z -------------------------------------------- 2025-04-23T02:14:16.789Z 2025-04-23T02:14:16.794Z Running custom build: npx esbuild src/client/index.tsx --bundle --outdir=public/dist --splitting --sourcemap --format=esm 2025-04-23T02:14:17.297Z 2025-04-23T02:14:17.298Z public/dist/index.js 1.0mb โš ๏ธ 2025-04-23T02:14:17.298Z public/dist/index.css 572b 2025-04-23T02:14:17.298Z public/dist/index.js.map 1.6mb 2025-04-23T02:14:17.298Z public/dist/index.css.map 1.1kb 2025-04-23T02:14:17.298Z 2025-04-23T02:14:17.298Z โšก Done in 91ms 2025-04-23T02:14:19.714Z ๐ŸŒ€ Building list of assets... 2025-04-23T02:14:19.740Z ๐ŸŒ€ Starting asset upload... 2025-04-23T02:14:22.371Z ๐ŸŒ€ Found 6 new or modified static assets to upload. Proceeding with upload... 2025-04-23T02:14:22.372Z + /dist/index.css 2025-04-23T02:14:22.372Z + /normalize.css 2025-04-23T02:14:22.372Z + /index.html 2025-04-23T02:14:22.372Z + /dist/index.js 2025-04-23T02:14:22.373Z + /dist/index.css.map 2025-04-23T02:14:22.374Z + /dist/index.js.map 2025-04-23T02:14:23.823Z Uploaded 2 of 6 assets 2025-04-23T02:14:26.199Z Uploaded 4 of 6 assets 2025-04-23T02:14:27.055Z Uploaded 6 of 6 assets 2025-04-23T02:14:27.055Z โœจ Success! Uploaded 6 files (4.68 sec) 2025-04-23T02:14:27.055Z 2025-04-23T02:14:27.058Z Total Upload: 21.02 KiB / gzip: 5.66 KiB 2025-04-23T02:14:28.016Z Your worker has access to the following bindings: 2025-04-23T02:14:28.016Z - Durable Objects: 2025-04-23T02:14:28.016Z - Globe: Globe 2025-04-23T02:14:28.018Z 2025-04-23T02:14:28.073Z โœ˜ [ERROR] A request to the Cloudflare API (/accounts/be15156c5ed5c863301ca25558ffa559/workers/scripts/multiplayer-globe) failed. 2025-04-23T02:14:28.073Z 2025-04-23T02:14:28.074Z In order to use Durable Objects with a free plan, you must create a namespace using a `new_sqlite_classes` migration. [code: 10097] 2025-04-23T02:14:28.074Z 2025-04-23T02:14:28.074Z If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose 2025-04-23T02:14:28.074Z 2025-04-23T02:14:28.074Z 2025-04-23T02:14:28.074Z 2025-04-23T02:14:28.075Z Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md 2025-04-23T02:14:28.138Z Failed: error occurred while running deploy command ```

AI Analysis

This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by knowlet and has received 0 comments.

Add a comment
Comment form would go here