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

These seem related maybe?

#2499

#2197

Expected Behavior

I should be able to add a .babelrc with a custom plugin and the next/babel preset and everything should work without having to include the env preset.

Current Behavior

When doing this I'm getting the following error when running tests (with Jest):

~/Developer/glamorous-with-next (pr/fix-config)
😇 $ npm run test --silent
FAIL components/__tests__/toggle-button.js
● Test suite failed to run

/Users/kdodds/Developer/glamorous-with-next/components/__tests__/toggle-button.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){var _jsxFileName = '/Users/kdodds/Developer/glamorous-with-next/components/__tests__/toggle-button.js';import React from 'react';
^^^^^^

SyntaxError: Unexpected token import

at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.908s
Ran all test suites.

Steps to Reproduce (for bugs)

Run the following script (from a directory of your choosing):

mkdir next-preset-issue
cd next-preset-issue
npm init -y
npm install next react react-dom jest babel-preset-env --save
echo "{\"presets\": [\"next/babel\"]}" > .babelrc
echo "import fs from 'fs';test('works', () => {});" > index.test.js
./node_modules/.bin/jest
echo "{\"presets\": [\"next/babel\", \"env\"]}" > .babelrc
./node_modules/.bin/jest

You'll notice that the first invocation of jest will fail with the error above, but the second (after adding the env preset has been added) will succeed.

Context

I'm making a course for glamorous and I want to show how to do server rendering and testing. Next.js is the obvious choice, but I want to make sure I'm doing things properly and no more than necessary. If it's necessary to add the env preset that's fine, but I want to make sure that I understand why it's necessary.

Your Environment

Tech
Version

next
v3.2.1

node
v8.3.0

OS
macOS

browser
N/A

Thanks!

Issue 2:
I am developing a nextjs app that runs on google cloud functions. Cloud functions requires node v.6.14.0 and the local function emulator needs v.6.14.0 as well. Since I upgraded to next 6, I am getting the following error when running the next dev server:

/project/node_modules/update-check/index.js:18
const getFile = async (details, distTag) => {
^
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Server._callee$ (/project/node_modules/next/dist/server/index.js:194:34)
...

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

This is related to #4258, but this has been closed because they could resolve the issue by updating the node version. However, I would like to keep the node version at v6.14 because I would like to keep my dev environment as close as possible to google cloud functions.

Expected Behavior

Should work as expected, like in next v5.

Current Behavior

Throws the error described above and does not start up the dev server.

Steps to Reproduce (for bugs)

Use Node v.6.14.0

Install Dependencies

run next

Your Environment

Tech
Version

next
6.0.0

node
6.14.0

OS
Arch Linux

browser
Chrome