fast-reflexes / better-react-mathjax

MIT License
124 stars 16 forks source link

Not working with serve -s build #51

Closed atigm closed 7 months ago

atigm commented 8 months ago

On my Localhost it's working fine, but when I deploy on AWS Amlify, It's not working, there is not rendering. On my localhost I have like that : <mjx-container class="MathJax .... But on production (AWS Amplify), I don't have <mjx-container class="MathJax ....

Amplify use these commands :

npm install -g serve 
serve -s build

(https://cra.link/deployment)

I use React 18 with Typescript.

fast-reflexes commented 8 months ago

Can you replicate this locally with serve -s build? I assume build here is a folder where your built project resides? If you could push a git repo where this problem is seen which I can fork, it would be super :)

atigm commented 8 months ago

Thank you @fast-reflexes I'm sending you the link to the repo that contains the build content file.

atigm commented 7 months ago

I realized that the library doesn't work with 'npm run build'. It only works in development mode with 'npm start'.

fast-reflexes commented 7 months ago

Nah, I have an app which is built and served from Amazon S3 which works great so that's not the problem. I will have a look in the weekend if I have time :)

atigm commented 7 months ago

@fast-reflexes Ok, Thank you

atigm commented 7 months ago

It's just a mistake on my part; I forgot to add dynamic: <MathJax dynamic>

fast-reflexes commented 7 months ago

Yeah, local development uses dynamic automatically to work correctly with hot reload, when deploying in production you have to make sure to add this explicitly for typesetting updated content :)