Skip to content

TS2742 type annotation necessary for basic usage #153

@djMax

Description

@djMax

Description

When converting from vanilla-extract/sprinkles to rainbow-sprinkles, Typescript 5.2 gets tripped up with a confusing error:

The inferred type of 'sprinkles' cannot be named without a reference to '../../node_modules/rainbow-sprinkles/dist/declarations/src/createRuntimeFn'. This is likely not portable. A type annotation is necessary.ts(2742)

Expected Behaviour

Proper inferred typing.

Actual Behaviour

typescript build fails

Affected Version

0.17.0

Steps to Reproduce

Possibly the tsconfig?

  "compilerOptions": {
    "incremental": true,
    "lib": [
      "ES2022",
      "DOM"
    ],
    "target": "ES2022",
    "module": "NodeNext",
    "allowJs": true,
    "preserveWatchOutput": true,
    "outDir": "dist/",
    "strict": true,
    "declaration": true,
    "sourceMap": true,
    "isolatedModules": true,
    "moduleResolution": "NodeNext",
    "baseUrl": "./src",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "resolveJsonModule": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "preserve",
    "paths": {
      "@/*": [
        "./*"
      ]
    },
    "noEmit": true,
    "skipLibCheck": true
  }

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions