Skip to content

export UnionConditional to allow exporting validators using using vine.union.if #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

adrianNEMO
Copy link

@adrianNEMO adrianNEMO commented May 20, 2025

πŸ”— Linked issue

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

When exporting a validator from a package using vine.union.if the compilation fails with error:

- error TS2742: The inferred type of 'myValidator' cannot be named without a reference to '../../node_modules/@vinejs/vine/build/src/schema/union/conditional.js'. This is likely not por β”‚ table. A type annotation is necessary.

Exporting UnionConditional fixes this issue.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@thetutlage
Copy link
Contributor

Can you please share the tsconfig.json file of the package?

@adrianNEMO
Copy link
Author

Sure the output of tsc --showConfig

    "compilerOptions": {
        "strict": true,
        "strictNullChecks": true,
        "noEmit": false,
        "isolatedModules": true,
        "module": "nodenext",
        "moduleResolution": "nodenext",
        "target": "esnext",
        "lib": [
            "esnext"
        ],
        "forceConsistentCasingInFileNames": true,
        "noEmitOnError": true,
        "noFallthroughCasesInSwitch": true,
        "noImplicitOverride": false,
        "noImplicitReturns": false,
        "noUnusedParameters": true,
        "noUnusedLocals": true,
        "skipLibCheck": true,
        "resolvePackageJsonImports": true,
        "preserveWatchOutput": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strictPropertyInitialization": true,
        "noImplicitAny": true,
        "strictBindCallApply": true,
        "strictFunctionTypes": true,
        "noImplicitThis": true,
        "useUnknownInCatchVariables": false,
        "skipDefaultLibCheck": true,
        "declaration": true,
        "rootDir": "./",
        "outDir": "./dist",
        "moduleDetection": "force",
        "resolvePackageJsonExports": true,
        "preserveConstEnums": true,
        "useDefineForClassFields": true,
        "strictBuiltinIteratorReturn": true,
        "alwaysStrict": true
    },
    "exclude": [
        "node_modules",
        "**/*.spec.ts",
        "dist"
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants