Issue 1:
Looks like the babel-runtime alias in the webpack config is causing babel to transpile incorrectly. Any async function defined on the module fails because _regenerator2 is undefined. If the aysnc function is defined within a class, like with getInitialProps, everything works. Without the alias everything appears to work. I'm using next@1.1.0.

pages/index.js

async function test() {

}

throws:

TypeError: Cannot read property 'default' of undefined
at /Users/amccloud/Labs/Auth0/next-auth0/.next/dist/pages/index.js:4:36
at Object.<anonymous> (/Users/amccloud/Labs/Auth0/next-auth0/.next/dist/pages/index.js:19:2)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at _callee$ (/Users/amccloud/Labs/Auth0/next-auth0/node_modules/next/dist/server/require.js:33:46)

with babel-runtime alias

"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.test = undefined;

var test = exports.test = function () {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { // _regenerator2 undefined
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

return function test() {
return _ref.apply(this, arguments);
};
}();

var _regenerator = require("/Users/amccloud/Labs/Auth0/next-auth0/node_modules/babel-runtime/regenerator");

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = require("/Users/amccloud/Labs/Auth0/next-auth0/node_modules/babel-runtime/helpers/asyncToGenerator");

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

without babel-runtime alias

"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.test = undefined;

var _regenerator = require("babel-runtime/regenerator");

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

var test = exports.test = function () {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));

return function test() {
return _ref.apply(this, arguments);
};
}();

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

possibly related issues

#168

Issue 2:
Hey guys, when I try to implement a custom .babelrc with next.config.js, I get a build error and it looks like its ignoring React Components (JSX).

.babelrc:

{
"presets": [
"next/babel"
],
"plugins": [
["transform-define", "./env-config.js"]
],
}

next.config.js:

// next.config.js

const webpack = require("webpack")
const withCSS = require('@zeit/next-css')

// Update these to match your package scope name.
const internalNodeModulesRegExp = /src(?!\/(?!.*js))/
const externalNodeModulesRegExp = /node_modules(?!\/@zeit(?!.*node_modules))/

module.exports = withCSS({
useFileSystemPublicRoutes: false,
webpack: (config, { dev, isServer, defaultLoaders }) => {
config.resolve.symlinks = false
config.externals = config.externals.map(external => {
if (typeof external !== "function") return external
return (ctx, req, cb) => (internalNodeModulesRegExp.test(req) ? cb() : external(ctx, req, cb))
})
config.module.rules.push({
test: [
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.svg$/,
],

use: {
loader: 'file-loader',
options: {}
}
});
console.log(defaultLoaders);
config.module.rules.push({
test: /\.+(js|jsx)$/,
use: defaultLoaders.babel,
include: [internalNodeModulesRegExp],
})
return config
},
webpackDevMiddleware: config => {
const ignored = [config.watchOptions.ignored[0], externalNodeModulesRegExp]
config.watchOptions.ignored = ignored
config.stats = {
warnings: false,
};
return config
},
distDir: 'next_build'
});

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

Current Behavior

BabelLoaderError: SyntaxError: Unexpected token (10:4)

8 | const NavList = ({activeLinkClass, horizontal, items, title, showIcon, styles, ssr}) => {
9 | return (
> 10 | <nav className={css(baseStyles.nav, styles.container)}>
| ^
11 | {title && (
12 | <h1 className={css(baseStyles.title, styles.title)}>{title}</h1>
13 | )}

at transpile (/Users/patricklu/Q5/lunyr/Lunyr-Frontend/server/node_modules/babel-loader/lib/index.js:65:13)
at /Users/patricklu/Q5/lunyr/Lunyr-Frontend/server/node_modules/babel-loader/lib/fs-cache.js:118:18
at ReadFileContext.callback (/Users/patricklu/Q5/lunyr/Lunyr-Frontend/server/node_modules/babel-loader/lib/fs-cache.js:31:21)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:419:13)
@ ../src/containers/components/base/index.js 17:0-47
@ ./pages/ReaderPage.js
@ multi ./pages/ReaderPage.js

Your Environment

Tech
Version

next
v5.0.0

node
v8.1.2

OS
macOs

browser
Chrome