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

no typescript support #875

Open
bitsmakerde opened this issue Jan 3, 2023 · 1 comment
Open

no typescript support #875

bitsmakerde opened this issue Jan 3, 2023 · 1 comment

Comments

@bitsmakerde
Copy link

Hallo,

I try since one day to get this nice gherkin edtor works in my react typescript project with vite.

But if I want set something else as "ref" I get this error:

image

I don't understand why typescript don't find the properties for the editor. How I can fix my issue?

Thank you

Here my Versions

    "@forge/bridge": "^2.5.0",
    "@smartbear/react-gherkin-editor": "^2.4.14",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@testing-library/react": "^13.4.0",
    "@types/react": "^18.0.26",
    "@types/react-dom": "^18.0.10",
    "@vitejs/plugin-react": "^3.0.0",
    "@vitest/coverage-c8": "^0.26.3",
    "jsdom": "^20.0.3",
    "typescript": "^4.9.3",
    "vite": "^4.0.0",
    "vitest": "^0.26.3"
  }
@bitsmakerde
Copy link
Author

I find a working solution:

in "@types/@smartbear/react-gherkin-editord.ts", but I think this editor should support TypeScript out of the box

declare module '@smartbear/react-gherkin-editor' {
  export interface GherkinEditorProps {
    initialValue: string;
    onChange: (value: string) => void;
    autoCompleteFunction: (
      keyword: string,
      text: string
    ) => Promise<Array<{ caption: string; value: string; score: number; meta: string }>>;
    language: string;
    theme: string;
  }

  export default class GherkinEditor extends React.Component<GherkinEditorProps> {}
}

I get some warings and error, because some maps for typescrpt are missing.


WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/components/GherkinEditor/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/GherkinEditor/index.jsx' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/GherkinEditor/index.jsx'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/components/GherkinEditor/styled.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/GherkinEditor/styled.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/GherkinEditor/styled.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/components/Toolbar/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/Toolbar/index.tsx' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/Toolbar/index.tsx'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/components/Toolbar/styled.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/Toolbar/styled.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/components/Toolbar/styled.ts'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/index.ts'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/lib/gherkin-languages/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/lib/gherkin-languages/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/lib/gherkin-languages/index.ts'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/lib/gherkin-linter/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/lib/gherkin-linter/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/lib/gherkin-linter/index.ts'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/dialects/gherkin_background_i18n.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/dialects/gherkin_background_i18n.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/dialects/gherkin_background_i18n.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/dialects/gherkin_i18n.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/dialects/gherkin_i18n.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/dialects/gherkin_i18n.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/dialects/gherkin_scenario_i18n.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/dialects/gherkin_scenario_i18n.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/dialects/gherkin_scenario_i18n.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/gherkin-annotator/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/gherkin-annotator/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/gherkin-annotator/index.ts'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/keyword-completer/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/keyword-completer/index.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/keyword-completer/index.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/mode/gherkin_background_i18n.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/mode/gherkin_background_i18n.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/mode/gherkin_background_i18n.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/mode/gherkin_i18n.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/mode/gherkin_i18n.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/mode/gherkin_i18n.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/mode/gherkin_scenario_i18n.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/mode/gherkin_scenario_i18n.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/mode/gherkin_scenario_i18n.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/modules/step-completer/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/step-completer/index.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/modules/step-completer/index.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/themes/cucumber.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/themes/cucumber.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/themes/cucumber.js'

WARNING in ./node_modules/@smartbear/react-gherkin-editor/dist/themes/jira.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/themes/jira.js' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@smartbear/react-gherkin-editor/src/themes/jira.js'

WARNING in ./node_modules/calculate-size/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/calculate-size/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/calculate-size/src/index.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/IdGenerator.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/IdGenerator.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/TimeConversion.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/TimeConversion.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/getWorstTestStepResult.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/getWorstTestStepResult.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/index.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/messages.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/messages.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/messages.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/parseEnvelope.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/parseEnvelope.ts'

WARNING in ./node_modules/@cucumber/messages/dist/cjs/src/version.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/version.ts' file: Error: ENOENT: no such file or directory, open '/Users/andre/Projekte/JS/Jira/gherkin-test/node_modules/@cucumber/messages/src/version.ts'

@bitsmakerde bitsmakerde changed the title no types for typescript are found no typescript support Jan 3, 2023
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

1 participant