Known issues
The library doesn't work in Internet Explorer 11
Make sure you're polyfilling all required functionality:
The easiest way is to add a generic polyfill:
- Babel 6 - Install
babel-polyfill@6and import it in your entry file - Babel 7 - Install
@babel/polyfilland import it in your entry file - TypeScript - If you're using the target
ES3,ES5or you don't have a target defined, you should add the libES2015to yourtsconfig.jsoncompiler options.
Usage in combination with Vite
If you're using DatX with Vite and MobX, you might have an issue where it works in dev builds, but not in production builds. This is because DatX needs the commonjs require in order to detect MobX support, but Vite doesn't transpile require calls in production builds for dependencies.
The solution is to use the vite-plugin-require-transform plugin to transform require calls in dependencies:
// vite.config.js
import requireTransform from 'vite-plugin-require-transform';
export default {
plugins: [
requireTransform({
fileRegex: /.ts$|.tsx$|node_modules\/@datx/,
}),
],
};
Using vite-plugin-commonjs might also be a possibility, but it was not yet confirmed.
Having other issues?
Feel free to open an issue.