Issue 1:
[x ] I have searched the issues of this repository and believe that this is not a duplicate.

Context

I combined with-emotion example and using-preact example. For production build I aliased react to preact as shown in using-preact example. After building the app(next build) and launching the app (next start) I am seeing below error in browser console.

Stack Trace

_.default.hydrate is not a function
TypeError: _.default.hydrate is not a function
at o (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:55939)
at http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:57828
at r (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:60761)
at Generator._invoke (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:61806)
at Generator.e.(anonymous function) [as next] (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:60940)
at r (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:29712)
at http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:29860
at new Promise (<anonymous>)
at new t (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:538)
at http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:29654
(anonymous) @ app.js:2
r @ app.js:2
(anonymous) @ app.js:2
e.(anonymous function) @ app.js:2
r @ app.js:2
(anonymous) @ app.js:2
t @ app.js:2
(anonymous) @ app.js:2
(anonymous) @ app.js:2
(anonymous) @ app.js:2
r @ app.js:2
(anonymous) @ app.js:2
e.(anonymous function) @ app.js:2
r @ app.js:2
(anonymous) @ app.js:2
Promise rejected (async)
r @ app.js:2
(anonymous) @ app.js:2
t @ app.js:2
(anonymous) @ app.js:2
(anonymous) @ app.js:2
(anonymous) @ app.js:2
r @ app.js:2
(anonymous) @ app.js:2
e.(anonymous function) @ app.js:2
r @ app.js:2
(anonymous) @ app.js:2
Promise resolved (async)
r @ app.js:2
(anonymous) @ app.js:2
Promise resolved (async)
r @ app.js:2
(anonymous) @ app.js:2
t @ app.js:2
(anonymous) @ app.js:2
(anonymous) @ app.js:2
n @ app.js:1
(anonymous) @ app.js:2
n @ app.js:1
window.webpackJsonp @ app.js:1
(anonymous) @ app.js:3
app.js:2 Uncaught (in promise) TypeError: _.default.hydrate is not a function
at o (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:55939)
at http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:57048
at r (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:60761)
at Generator._invoke (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:61806)
at Generator.e.(anonymous function) [as next] (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:60940)
at r (http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:29712)
at http://localhost:3000/_next/255b4ec75e53927fc721110ac93130bd/app.js:2:29808
at <anonymous>

Expected Behavior

Should not produce above error with preact. (It does not produce this error with react in production).

Current Behavior

In production app its producing error mentioned in above stack trace.

Steps to Reproduce (for bugs)

Download with-emotion example (instructions in its Readme)

Update next, react and react-dom to latest versions as versions used in this example are old.

yarn add next react react-dom

Install preact and preact-compat

yarn add preact preact-compat

Create next.config.js file at root of the project and add below content

module.exports = {
webpack: function (config, { dev }) {
// For the development version, we'll use React.
// Because, it supports react hot loading and so on.
if (dev) {
return config
}

config.resolve.alias = {
'react': 'preact-compat/dist/preact-compat',
'react-dom': 'preact-compat/dist/preact-compat'
}

return config
}
}

Then build and start the app

yarn build
yarn start

Open app https://localhost:3000 and check browsers console.

Your Environment

Tech
Version

next
^4.1.4

node
v8.6.0

OS
OSX 10.13.1

browser
chrome Version 64.0.3273.0 (Official Build) canary (64-bit)

preact
^8.2.6

preact-compat
^3.17.0

react
^16.1.1

react-dom
^16.1.1

emotion
^8.0.5

/cc @mitchellhamilton @tkh44

Issue 2:
can not swich react 16 to inferno, i try to clone https://github.com/zeit/next.js/tree/canary/examples/using-inferno but not work

I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Next.js 4 requires React 16

Current Behavior

Steps to Reproduce (for bugs)

next build

next start

Next.js 4 requires React 16

Context

Your Environment

Tech
Version

next
4

node
9

OS
osx

browser
chrome

etc