Rollup : Uncaught TypeError: Cannot destructure property 'class' of 'object null' as it is null

22 views Asked by At

I am trying to create a hyperapp application with Rollup. The hyperapp syntax should be written in JSX. So we need compiler to transform JSX into native hyperapp h function calls. The bundle is created but I run into the following error:

Uncaught TypeError: Cannot destructure property 'class' of 'object null' as it is null. at h (bundle.js:207:12) at view (bundle.js:245:27) at render (bundle.js:233:73)

Here is the rollup.config.js:

 export default {
 input: 'src/index.js', 
 output: {
    file: 'public/dist/bundle.js',
    format: 'iife'
 },
 plugins: [
    babel({
        babelrc: false,
        presets: [
            ["@babel/preset-react", { runtime: "automatic" }],
        ],
        plugins: [
            ["transform-react-jsx", { pragma: "h" }]
        ]
    }),
    resolve({
        jsnext: true
    })
    ]}    

I am expecting to see the Hello world in the browser.

0

There are 0 answers