Issue 1:
Examples bug report

Example name

auth0

Describe the bug

builds with errors

To Reproduce

npx create-next-app --example auth0 auth0

Change target to serverless

yarn build

See error

Expected behavior

Should build with no errors

Screenshots

Creating an optimized production build

Compiled with warnings.

/Users/alisowski/Documents/kikbak-2/node_modules/got/source/request-as-event-emitter.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

/Users/alisowski/Documents/kikbak-2/node_modules/next/dist/next-server/server/load-components.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/next/dist/next-server/server/load-components.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/next/dist/next-server/server/load-components.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/next/dist/next-server/server/load-components.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/next/dist/next-server/server/require.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/next/dist/next-server/server/require.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/encoding/lib/iconv-loader.js
Critical dependency: the request of a dependency is an expression

/Users/alisowski/Documents/kikbak-2/node_modules/keyv/src/index.js
Critical dependency: the request of a dependency is an expression

> Build error occurred
{ Error: The cookieSecret setting is empty or null
at new CookieSessionStoreSettings (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:22328:19)
at Object.createInstance [as default] (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:7667:29)
at initAuth0 (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:21557:47)
at Object.2NqA (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:2846:127)
at __webpack_require__ (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:23:31)
at Module.qWSV (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:36832:13)
at __webpack_require__ (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:23:31)
at module.exports.+3SS.strict (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:91:18)
at Object.<anonymous> (/Users/alisowski/Documents/kikbak-2/packages/test/.next/serverless/pages/advanced/ssr-profile.js:94:10)

System information

OS: macOS

Version of Next.js: 9.1.6

Issue 2:
Bug report

Describe the bug

When deployed I get a TypeError: require is not a function error when importing npm module in api/allMovies.js. It works locally but not when deployed.

To Reproduce

clone https://github.com/tenjojeremy/test-nextjs-simple

run yarn

run yarn start

open localhost: 3000

You should see movie posters as expected

Deploy site

open deployed site url

you will see Internal Server Error

logs will show error log:

Expected behavior

On prod site, movies should be fetched and appear on screen on initial load

Additional context

Related to #7850

Thank you