Fix app when built in production mode

The recent typescripting appears to have caused the typescript
compiler to get confused about dependency references and start
refwrencing things like CRYPTO_ENABLED in the js-sdk before it's
defined them.

This avoids using things from the (javascript) browser-index import
and instead pulls everything in from the typescript files, then
fixes the resulting type failures, (in some cases with hacks).
This commit is contained in:
David Baker
2022-06-01 15:55:02 +01:00
parent 7ee2f630db
commit 0411e1cac8
3 changed files with 21 additions and 8 deletions

View File

@@ -14,6 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// We need to import this somewhere, once, so that the correct 'request'
// function gets set. It needs to be not in the same file as we use
// createClient, or the typescript transpiler gets confused about
// dependency references.
import "matrix-js-sdk/src/browser-index";
import React from "react";
import ReactDOM from "react-dom";
import { createBrowserHistory } from "history";