flogy / gatsby-mdx-tts-example Goto Github PK
View Code? Open in Web Editor NEWExample of the gatsby-mdx-tts plugin, which adds speech output to a Gatsby site using Amazon Polly.
License: MIT License
Example of the gatsby-mdx-tts plugin, which adds speech output to a Gatsby site using Amazon Polly.
License: MIT License
Some facts:
gatsby develop
is working fine, also when adding SpeechOutput
components.gatsby build
works as long as the SpeechOutput
components are removed from /content/posts/curses-and-counter-courses/index.mdx
gatsby build
fails if SpeechOutput
components are usedError message:
The error message seems to point to an unhandled promise rejection. However, when handling it in the gatsby-mdx-tts
plugin code there will be other errors. What stays the same is this:
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.htmlinvariant=31&args[]=%5Bobject%20Promise%5D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Speculation:
I had problems before because there is some code only intended to be executed at build time (to generate the TTS files). For some reason it gets imported to the runtime / SSR when the SpeechOutput
component is used.
To solve that original problem I have added the browser
field to the plugin's package.json
which has helped from including the TTS-generating code at runtime but it seems to now not be working for SSR...
// Inside plugin's package.json
"main": "index.js",
"browser": "SpeechOutput.js",
Upload this example page to Netlify and link it in the plugin's README file so interested people can directly try and see the speech output. Issue #1 needs to be resolved first though.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.