Issue 1:
When following the tutorial, I get a syntax error.

Package.json:

{

"name": "next-version",

"version": "1.0.0",

"description": "",

"main": "index.js",

"scripts": {

"dev": "next"

},

"keywords": [],

"author": "",

"license": "ISC",

"dependencies": {

"next": "^6.0.0",

"react": "^16.3.2",

"react-dom": "^16.3.2"

}

}

Console IO:

Per-ivinds-MacBook-Pro:next-version poa$ npm run dev

next-version@1.0.0 dev /Users/poa/Documents/dev/smileyhash/next-version

next

/Users/poa/Documents/dev/smileyhash/next-version/node_modules/update-check/index.js:18

const getFile = async (details, distTag) => {

^

SyntaxError: Unexpected token (

at Object.exports.runInThisContext (vm.js:78:16)

at Module._compile (module.js:543:28)

at Object.Module._extensions..js (module.js:580:10)

at Module.load (module.js:488:32)

at tryModuleLoad (module.js:447:12)

at Function.Module._load (module.js:439:3)

at Module.require (module.js:498:17)

at require (internal/module.js:20:19)

at Server._callee$ (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/next/dist/server/index.js:194:34)

at tryCatch (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/regenerator-runtime/runtime.js:62:40)

at Generator.invoke [as _invoke] (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/regenerator-runtime/runtime.js:296:22)

at Generator.prototype.(anonymous function) [as next] (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/regenerator-runtime/runtime.js:114:21)

at step (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)

at _next (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)

at /Users/poa/Documents/dev/smileyhash/next-version/node_modules/@babel/runtime/helpers/asyncToGenerator.js:34:7

at F (/Users/poa/Documents/dev/smileyhash/next-version/node_modules/core-js/library/modules/_export.js:36:28)

npm ERR! Darwin 17.5.0

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"

npm ERR! node v7.2.0

npm ERR! npm v3.10.9

npm ERR! code ELIFECYCLE

npm ERR! next-version@1.0.0 dev: next

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the next-version@1.0.0 dev script 'next'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the next-version package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR! next

npm ERR! You can get information on how to open an issue for this project with:

npm ERR! npm bugs next-version

npm ERR! Or if that isn't available, you can get their info via:

npm ERR! npm owner ls next-version

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR! /Users/poa/Documents/dev/smileyhash/next-version/npm-debug.log

Per-ivinds-MacBook-Pro:next-version poa$

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

Expected Behavior

Current Behavior

Steps to Reproduce (for bugs)

Context

Your Environment

Tech
Version

next

node

OS

browser

etc

Issue 2:
Next.js has example and work with sw-precache as service-worker.

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

Expected Behavior

It should be possible to use Workbox and workbox-webpack-plugin to create a service worker.

Current Behavior

When adding following to next.config.js:

config.plugins.push(new WorkboxPlugin({ globDirectory: path.resolve('./.next/dist/'), globPatterns: ['**/*.{html,js,css}'], swDest: path.resolve('./static/sw/service-worker.js'), clientsClaim: true, skipWaiting: true, }))

it fails with error:

Error: One of the glob patterns doesn't match any files. Please remove or fix the following: { "globDirectory": "/...../.next/dist", "globPattern": "**/*.{html,js,css}", "globIgnores": [ "node_modules/**/*", "../../static/sw/workbox-sw.prod.v2.1.2.js", "../../static/sw/service-worker.js" ]

Your Environment

Tech
Version

next
4.2.0

node
8.9.0