Closed fheyen closed 3 years ago
Correction, the workaround does not work.
I also tried babel-polyfill (inspired by this stackoverflow post), and the newer way of polyfilling, but there's still the same error...
So I assume that it is just not possible to use druid in a React app currently.
When trying to use DruidJS in a React application that uses (un-ejected) create-react-app, I came across the following error when importing druid using either
import * as druid from '@saehrimnir/druidjs';
orimport * as druid from '@saehrimnir/druidjs/dist/druid.js';
(same with .min)I found a workaround that allows customizing the babel config without ejecting: https://devinschulz.com/modify-create-react-apps-babel-configuration-without-ejecting/
This works for me, but I would prefer druid to 'just work' also with React, since others might not be able to figure out a solution and might therefore abandon the library. Maybe there is a way to transpile the code, such that experimental features are avoided.