Skip to content

[BUG]: Error when importing react component with octokit dependency #2447

@rwxmad

Description

@rwxmad

What happened?

I have a react+typescript component that has an octokit dependency.

import React, { FC, useEffect, useState } from "react";
import { Octokit } from "octokit";

export const Graph: FC<IProps> = ({ token, theme }) => {...code}

Project structure:

.
├── example
  ├── public
    └── index.html
  ├── src
    ├── App.tsx
    ├── index.css
    └── index.tsx
  ├── .gitignore
  ├── package-lock.json
  ├── package.json
  ├── README.md
  └── tsconfig.json
├── lib
  ├── components
    ├── Graph.d.ts
    └── Graph.js
  ├── index.d.ts
  └── index.js
├── src
  ├── components
    └── Graph.tsx
  └── index.tsx
├── .gitignore
├── package-lock.json
├── package.json
└── tsconfig.json

I use tsc to build everything from src to the lib folder, and in the example folder I created a project using create-react-app, where I import the component from lib/index.js, which was compiled with tsc. But when I run the application in the folder example produces an error:

Failed to parse source map from '/Users/rwxmad/code/github/react-github-contribution-graph/node_modules/@octokit/auth-app/dist-node/index.js.map' file: Error: ENOENT: no such file or directory, open '/Users/rwxmad/code/github/react-github-contribution-graph/node_modules/@octokit/auth-app/dist-node/index.js.map'

How to fix that error?

Versions

Octokit v2.0.14
NodeJs v19.8.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions