Skip to content

Template with a compilerVersion that is a semver range doesn't work #2743

Description

@timotheeguerin

Setting ^0.50.0 crash with

TypeError: Invalid Version: ^0.50.0
    at new SemVer (/Users/timotheeguerin/dev/azsdk/typespec/common/temp/node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js:38:13)
    at compare (/Users/timotheeguerin/dev/azsdk/typespec/common/temp/node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js:3:32)
    at Module.gte (/Users/timotheeguerin/dev/azsdk/typespec/common/temp/node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js:2:30)
    at validateTemplate (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/compiler/src/init/init.ts:314:42)
    at initTypeSpecProject (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/compiler/src/init/init.ts:149:36)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at initAction (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/compiler/src/core/cli/actions/init.ts:15:5)
    at Object.handler (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/compiler/src/core/cli/utils.ts:47:25)

This one might be tricky to solve because the current behavior is that the version passed is more treated like a minimum instead of semver

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions