Skip to content

Tevinthuku/next-js7-webworker-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reproducing the error (with next@7.0,2)

  1. npm install
  2. npm run dev

Error dissapears with next@6.1.1

  1. npm install next@6.1.1
  2. npm run dev
  3. Everying works as expected

Resolved

Please visit webpack/webpack#6642 for more information in the mean time

in your next.config.js

const withWorkers = require("@zeit/next-workers");
module.exports = withWorkers({
  webpack(config, options) {
    // add this to make the web workers work in next js version 7
    config.output.globalObject = `(typeof self !== 'undefined' ? self : this)`;
    return config;
  }
});

and the error goes away :)

About

Created a sample project to reporduce web worker issues

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published