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@6
and import it in your entry file - Babel 7 - Install
@babel/polyfill
and import it in your entry file - TypeScript - If you're using the target
ES3
,ES5
or you don't have a target defined, you should add the libES2015
to yourtsconfig.json
compiler 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.