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

TS Errors when importing ReactLinearGenomeView #3765

Closed
joneubank opened this issue Jun 27, 2023 · 5 comments
Closed

TS Errors when importing ReactLinearGenomeView #3765

joneubank opened this issue Jun 27, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@joneubank
Copy link

joneubank commented Jun 27, 2023

Describe the bug

Projects importing JBrowse React Linear View have errors running tsc. There are *.ts in the /src directory of the imported dependency, inside node_modules/, and these are failing TS type checking.

To Reproduce

A repository with a minimal project showing how to reproduce is here: https://github.com/joneubank/minimal-reproduce-jbrowse-component-build

Steps to reproduce and a further description of the errors are in the README of that repo.

Expected behavior

Should be able to run tsc build on a project importing JBrowse React Linear Genome View, without having to modify our tsconfig or needing additional 3rd party dependencies.

Screenshots

Version:

"dependencies": {
    "@jbrowse/react-linear-genome-view": "^2.6.1",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  },
  "devDependencies": {
    "@types/react": "18.0.25",
    "@types/react-dom": "18.0.9",
    "typescript": "5.1.3"
  },

Additional context

This issue did not occur for us with the Circular Genome View, even though that repo also exports the /src folder. I would recommend removing the /src files from the exported pacakges to prevent this kind of error in the future.

This relates to #3764 and the two may in fact be duplicates now.

@joneubank joneubank added the bug Something isn't working label Jun 27, 2023
@cmdcolin
Copy link
Collaborator

that is really odd that adding @types/jest fixes all the errors. I think I can confirm locally too.

we can likely do the inlinesourcemaps change and see if that helps though

@joneubank
Copy link
Author

joneubank commented Jun 27, 2023

Yeah the jest import thing confounds me... inlinesourcemaps seems like a promising route though, happy to trial any test builds you can provide. Likely need to also remove src from the files array in the package.json.

@cmdcolin
Copy link
Collaborator

added a change in #3771 and tested out your repro with the change, should hopefully be fixed next release!

@cmdcolin
Copy link
Collaborator

@joneubank published v2.6.2 with no source maps/src folder (inline source maps still needed src folder to do properly, but we dont mangle our builds too much so just published with no source map)

also fixed an error with the @jbrowse/react-circular-genome-view. lemme know if there are any other issues you run into!

@cmdcolin
Copy link
Collaborator

(the react-circular-genome-view issue that was fixed was properly publishing commonjs code in the dist folder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants