Skip to content

Commit

Permalink
fix: new app generated by blitz new causes Error: DYNAMIC_SERVER_USAGE (
Browse files Browse the repository at this point in the history
#4113)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
vitaliemiron and kodiakhq[bot] authored Apr 7, 2023
1 parent ac587b6 commit 38d945a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/plenty-gifts-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"blitz": patch
---

The issue is that the version provided, "13.2", is not a valid SemVer version. A valid SemVer version must have three components: major, minor, and patch (e.g., "13.2.0").
3 changes: 2 additions & 1 deletion packages/blitz/src/cli/utils/codegen-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const codegenTasks = async () => {
const nextClientIndex = join(nextDir, "../..", "client", "index.js")
const readFile = await fs.readFile(nextClientIndex)
const packageJson = await getPackageJson()
const nextVersion = packageJson.dependencies.next
const version = packageJson.dependencies.next
const nextVersion = semver.clean(version, {loose: true}) || semver.valid(semver.coerce(version))

if (nextVersion && /^([~^])?12/.test(nextVersion)) {
const updatedFile = readFile
Expand Down

0 comments on commit 38d945a

Please sign in to comment.