CharlieMcVicker / mathjax-react

React Component Library for MathJax
33 stars 14 forks source link

Typescript error when running `tsc` in CI #40

Open danny-does-stuff opened 1 year ago

danny-does-stuff commented 1 year ago

This is a strange problem and I'm not sure the root cause. The issue is that running tsc in my project works fine when run locally, but when running in our CI pipeline it chokes on mathjax-react. The error I'm getting is

node_modules/mathjax-react/dist/utils/index.d.ts(1,28): error TS2307: Cannot find module './useMathJax' or its corresponding type declarations.

Any help would be appreciated!

danny-does-stuff commented 1 year ago

Update: it appears to be a simple problem of the file casing being wrong. In dist/utils/index.d.ts it imports from useMathJax, but the file is actually named useMathjax.d.ts. This error doesn't appear on our local machines because we are on macOS which is case insensitive. It looks like the file has the wrong name in the build folder. I could attempt to fix this, but I'm not sure how rollup works or how the build process is setup. Hopefully this is an easy fix!