Skip to content

Typescript issue #188

@jdortegar

Description

@jdortegar

Bug report for Cloudinary React SDK

Before proceeding, please update to latest version and test if the issue persists

Describe the bug in a sentence or two.

I updated my proyect to node v12.16 and I'm getting this error:

Property 'seeThru' of type 'string | undefined' is not assignable to string index type 'string'

Issue Type (Can be multiple)

[ ] Build - Can’t install or import the SDK
[ ] Babel - Babel errors or cross browser issues
[ ] UI/Performance - Display or performance issues
[ ] Behaviour - Functions aren’t working as expected (Such as generate URL)
[ ] Documentation - Inconsistency between the docs and behaviour
[x] Incorrect Types - For typescript users who are having problems with our d.ts files
[ ] Other (Specify)

Steps to reproduce

1- Install dependencies
2- Run the project

Error screenshots

Screen Shot 2020-08-10 at 12 53 40

Browsers (if issue relates to UI, else ignore)

[ ] Chrome
[ ] Firefox
[ ] Safari
[ ] Other (Specify)
[ ] All

Versions and Libraries (fill in the version numbers)

React Cloudinary SDK - 1.22
React - ^16.13.1
react-app-rewired:^2.1.0
Node - 12.16.0
NPM - v6.14.7

Config Files (Please paste the following files if possible)

Package.json

{
  "name": "ecomm",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ant-design/icons": "^4.0.6",
    "@juggle/resize-observer": "^2.3.0",
    "@sentry/browser": "^5.9.0",
    "antd": "^4.0.4",
    "apollo-boost": "^0.4.7",
    "apollo-link": "^1.2.14",
    "apollo-link-http": "^1.5.17",
    "axios": "^0.18.0",
    "babel-polyfill": "^6.26.0",
    "classnames": "^2.2.6",
    "cloudinary": "^1.22.0",
    "cloudinary-react": "^1.6.6",
    "date-fns": "^1.30.1",
    "flexboxgrid": "^6.3.1",
    "graphql": "^14.1.1",
    "haversine": "^1.1.1",
    "history": "^4.9.0",
    "inflection": "^1.12.0",
    "js-sha256": "^0.9.0",
    "lodash": "^4.17.11",
    "node-sass": "^4.11.0",
    "numeral": "^2.0.6",
    "objectFitPolyfill": "^2.3.0",
    "prop-types": "^15.7.2",
    "rc-progress": "^2.5.2",
    "react": "^16.13.1",
    "react-accessible-accordion": "^3.0.0",
    "react-albus": "^2.0.0",
    "react-apollo": "^3.1.3",
    "react-apollo-hooks": "^0.5.0",
    "react-dom": "^16.13.0",
    "react-dropzone": "^5.0.1",
    "react-google-places-autocomplete": "^2.0.5",
    "react-helmet": "^5.2.1",
    "react-lazy-load": "^3.0.13",
    "react-lazyload": "^2.6.5",
    "react-markdown": "^4.0.8",
    "react-modal": "^3.8.1",
    "react-plx": "^1.3.12",
    "react-redux": "^6.0.1",
    "react-resize-detector": "^3.2.1",
    "react-router-dom": "^5.1.2",
    "react-router-hash-link": "^1.2.2",
    "react-scripts": "^3.4.1",
    "react-select": "^2.4.1",
    "react-slick": "^0.26.1",
    "react-spring": "^8.0.25",
    "react-test-renderer": "^16.8.4",
    "react-transition-group": "4.3.0",
    "react-use": "^13.14.0",
    "react-waypoint": "^9.0.1",
    "recompose": "^0.30.0",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0",
    "reset-css": "^4.0.1",
    "showdown": "^1.9.1",
    "slick-carousel": "^1.8.1",
    "smoothscroll-polyfill": "^0.4.3",
    "storybook-react-router": "^1.0.5",
    "typescript": "^3.3.3333",
    "typings": "^2.1.1",
    "typography": "^0.16.19",
    "uuid": "^8.0.0",
    "yarn": "^1.19.0"
  },
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test --env=jsdom",
    "eject": "react-app-rewired eject",
    "flow": "flow",
    "storybook": "start-storybook -p 6006",
    "build-storybook": "build-storybook -c .storybook",
    "cbt-test": "node ./tests/index.js",
    "lint": "eslint src/**",
    "format": "prettier --write 'src/**/*.js*'",
    "plop": "plop"
  },
  "browserslist": {
    "development": [
      "last 2 chrome versions",
      "last 2 firefox versions",
      "last 2 edge versions",
      "ie 11"
    ],
    "production": [
      ">0.25%",
      "not op_mini all",
      "ie 11"
    ]
  },
  "devDependencies": {
    "@babel/core": "^7.4.4",
    "@babel/plugin-syntax-jsx": "^7.2.0",
    "@storybook/addon-actions": "^5.0.11",
    "@storybook/addon-info": "^5.0.11",
    "@storybook/addon-knobs": "^5.0.11",
    "@storybook/addon-links": "^5.0.11",
    "@storybook/addon-viewport": "^5.0.11",
    "@storybook/addons": "^5.0.11",
    "@storybook/react": "^5.0.11",
    "@types/classnames": "^2.2.7",
    "@types/graphql": "^14.0.7",
    "@types/inflection": "^1.5.28",
    "@types/jest": "^24.0.11",
    "@types/lodash": "^4.14.122",
    "@types/node": "^14.0.27",
    "@types/numeral": "^0.0.25",
    "@types/react": "^16.9.46",
    "@types/react-dom": "^16.9.8",
    "@types/react-helmet": "^5.0.8",
    "@types/react-lazyload": "^2.6.0",
    "@types/react-redux": "^7.0.9",
    "@types/react-resize-detector": "^3.1.1",
    "@types/react-router-dom": "^5.1.5",
    "@types/react-slick": "^0.23.3",
    "@types/segment-analytics": "^0.0.30",
    "@types/typography": "^0.16.2",
    "@typescript-eslint/eslint-plugin": "^3.8.0",
    "@typescript-eslint/parser": "^3.8.0",
    "customize-cra": "^0.2.12",
    "env-cmd": "^8.0.2",
    "enzyme": "^3.9.0",
    "enzyme-adapter-react-16": "^1.10.0",
    "eslint": "^6.6.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-prettier": "^3.1.2",
    "eslint-plugin-react-hooks": "^1.5.0",
    "flow-bin": "^0.94.0",
    "jest-localstorage-mock": "^2.4.0",
    "node-fetch": "^2.3.0",
    "plop": "^2.6.0",
    "prettier": "^2.0.5",
    "react-app-rewired": "^2.1.0",
    "react-docgen-typescript-loader": "^3.1.0",
    "selenium-webdriver": "^4.0.0-alpha.5",
    "tslint": "^5.13.1"
  }
}

Webpack.config (if applicable)
eslintrc

{
  "env": {
    "node": true,
    "browser": true,
    "es6": true,
    "jest": true
  },
  "settings": {
    "react": {
      "version": "^16.8.4"
    }
  },
  "root": true,
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module",
    "project": "./tsconfig.json"
  },
  "plugins": [
    "@typescript-eslint",
    "prettier",
    "react-hooks",
    "react"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "rules": {
    "prettier/prettier": "warn",
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "array-callback-return": "warn",
    "default-case": [
      "warn",
      {
        "commentPattern": "^no default$"
      }
    ],
    "dot-location": [
      "warn",
      "property"
    ],
    "eqeqeq": [
      "warn",
      "smart"
    ],
    "new-parens": "warn",
    "no-array-constructor": "warn",
    "no-caller": "warn",
    "no-cond-assign": [
      "warn",
      "except-parens"
    ],
    "no-const-assign": "warn",
    "no-control-regex": "warn",
    "no-console": 0,
    "no-delete-var": "warn",
    "no-dupe-args": "warn",
    "no-dupe-class-members": "warn",
    "no-dupe-keys": "warn",
    "no-duplicate-case": "warn",
    "no-empty-character-class": "warn",
    "no-empty-pattern": "warn",
    "no-eval": "warn",
    "no-ex-assign": "warn",
    "no-extend-native": "warn",
    "no-extra-bind": "warn",
    "no-extra-label": "warn",
    "no-fallthrough": "warn",
    "no-func-assign": "warn",
    "no-implied-eval": "warn",
    "no-invalid-regexp": "warn",
    "no-iterator": "warn",
    "no-label-var": "warn",
    "no-labels": [
      "warn",
      {
        "allowLoop": true,
        "allowSwitch": false
      }
    ],
    "no-lone-blocks": "warn",
    "no-loop-func": "warn",
    "no-mixed-operators": [
      "warn",
      {
        "groups": [
          [
            "&",
            "|",
            "^",
            "~",
            "<<",
            ">>",
            ">>>"
          ],
          [
            "==",
            "!=",
            "===",
            "!==",
            ">",
            ">=",
            "<",
            "<="
          ],
          [
            "&&",
            "||"
          ],
          [
            "in",
            "instanceof"
          ]
        ],
        "allowSamePrecedence": false
      }
    ],
    "no-multi-str": "warn",
    "no-native-reassign": "warn",
    "no-negated-in-lhs": "warn",
    "no-new-func": "warn",
    "no-new-object": "warn",
    "no-new-symbol": "warn",
    "no-new-wrappers": "warn",
    "no-obj-calls": "warn",
    "no-octal": "warn",
    "no-octal-escape": "warn",
    "no-redeclare": "warn",
    "no-regex-spaces": "warn",
    "no-restricted-syntax": [
      "warn",
      "WithStatement"
    ],
    "no-script-url": "warn",
    "no-self-assign": "warn",
    "no-self-compare": "warn",
    "no-sequences": "warn",
    "no-shadow-restricted-names": "warn",
    "no-sparse-arrays": "warn",
    "no-template-curly-in-string": "warn",
    "no-this-before-super": "warn",
    "no-throw-literal": "warn",
    "no-undef": "error",
    "no-unexpected-multiline": "warn",
    "no-unreachable": "warn",
    "no-unused-expressions": [
      "error",
      {
        "allowShortCircuit": true,
        "allowTernary": true,
        "allowTaggedTemplates": true
      }
    ],
    "no-unused-labels": "warn",
    "no-unused-vars": [
      "error",
      {
        "args": "none",
        "ignoreRestSiblings": true
      }
    ],
    "no-use-before-define": [
      "warn",
      {
        "functions": false,
        "classes": false,
        "variables": false
      }
    ],
    "no-useless-computed-key": "warn",
    "no-useless-concat": "warn",
    "no-useless-constructor": "warn",
    "no-useless-escape": "warn",
    "no-useless-rename": [
      "warn",
      {
        "ignoreDestructuring": false,
        "ignoreImport": false,
        "ignoreExport": false
      }
    ],
    "no-with": "warn",
    "no-whitespace-before-property": "warn",
    "require-yield": "warn",
    "rest-spread-spacing": [
      "warn",
      "never"
    ],
    "strict": [
      "warn",
      "never"
    ],
    "unicode-bom": [
      "warn",
      "never"
    ],
    "use-isnan": "warn",
    "valid-typeof": "warn",
    "no-restricted-properties": [
      "error",
      {
        "object": "require",
        "property": "ensure",
        "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting"
      },
      {
        "object": "System",
        "property": "import",
        "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting"
      }
    ],
    "getter-return": "warn",
    "react/forbid-foreign-prop-types": [
      "warn",
      {
        "allowInPropTypes": true
      }
    ],
    "react/jsx-no-comment-textnodes": "warn",
    "react/jsx-no-duplicate-props": [
      "warn",
      {
        "ignoreCase": true
      }
    ],
    "react/jsx-no-undef": "error",
    "react/jsx-pascal-case": [
      "warn",
      {
        "allowAllCaps": true,
        "ignore": []
      }
    ],
    "react/jsx-uses-react": "warn",
    "react/jsx-no-target-blank": 0,
    "react/jsx-uses-vars": "warn",
    "react/no-danger-with-children": "warn",
    "react/no-direct-mutation-state": "warn",
    "react/no-is-mounted": "warn",
    "react/react-in-jsx-scope": "error",
    "react/require-render-return": "error",
    "react/style-prop-object": "warn",
    "no-debugger": 0,
    "@typescript-eslint/ban-ts-comment": "warn",
    "no-empty-function": "warn",
    "@typescript-eslint/no-empty-function": "warn",
    "@typescript-eslint/explicit-module-boundary-types": "warn"
  }
}

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions