Export from "main" must be a function that returns an HTML string

112 Views Asked by At

I was following every step from this article about Static Site Generator https://css-tricks.com/css-modules-part-3-react/. The only thing i change from that article is the setting for .babelrc . On presets i use es2015 instead of es2016 and it looks like this

.babelrc

{
    "presets" : ["es2015","react"]
}

In the i got this following error

ERROR in Error: Export from "main" must be a function that returns an HTML string

What did i do wrong?

2

There are 2 best solutions below

1
On

You have to install the preset first, before you can use it.

npm install --save-dev babel-preset-es2015

I can't post comments yet, so I apologize if this doesn't fix the problem.

0
On

It's an issue with static-site-generator-webpack-plugin.

Look at the issue here. It should help you!