Skip to content
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

TS2345: Argument of type 'string' is not assignable to parameter of type #353

Open
MaxNvk opened this issue Sep 30, 2021 · 3 comments
Open

Comments

@MaxNvk
Copy link

MaxNvk commented Sep 30, 2021

Hi there! I have bug with types when i'm try to use $dayjs inside of vuex mutations (example in photo below). when i'm assign value directly, without using of $dayjs module, error dissapears.
image

my tsconfig.json file includes:

{
  "compilerOptions": {
    "target": "ES2018",
    "module": "ESNext",
    "moduleResolution": "Node",
    "lib": ["ESNext", "ESNext.AsyncIterable", "DOM", "DOM.Iterable"],
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "allowJs": true,
    "sourceMap": true,
    "strict": true,
    "jsx": "preserve",
    "noEmit": true,
    "declaration": true,
    "noUnusedLocals": false,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "suppressImplicitAnyIndexErrors": true,
    "allowSyntheticDefaultImports": true,
    "skipLibCheck": true,
    "experimentalDecorators": true,
    "baseUrl": ".",
    "paths": {
      "~/*": ["./*"],
      "@/*": ["./*"]
    },
    "types": ["@nuxt/types", "@nuxtjs/dayjs", "@nuxtjs/auth-next", "@nuxtjs/axios", "@types/node", "nuxt-i18n", "@nuxt/image"]
  },
  "exclude": ["node_modules", ".nuxt", "dist", "stories"]
}

Have any ideas why it occurs?

@potato4d
Copy link
Member

@MaxNvk
What state.offer.data.availableForm type is?

@MaxNvk
Copy link
Author

MaxNvk commented Oct 18, 2021

@potato4d
It has type availableForm: string | null;

@potato4d
Copy link
Member

thank you.
Cloud you share the detailed source code with the codesandbox URL?

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

No branches or pull requests

2 participants