mobxjs/mobx-preact

On production build: TypeError: Cannot call a class as a function, dev server works fine

pieterbergwerff opened this issue · 1 comments

In my app I use preact (preact-compat) & mobx-preact, in development mode (webpack-dev-server) everything works fine but when yarn build & yarn start my app, I get the following error message.

screen shot 2018-04-03 at 23 04 10

Anyone any ideas?

Hi Pieter, at a glance, using ReactDOMServer looks a bit fishy to me. You should use preact-render-to-string.

I think you can also alias it like this:

"alias": {
    "react-dom/server": "preact-compat/server"
}

Although, I always just use it directly.