<p dir="auto">After several hours, still no success. Next 8 was ok. I created this issue to track investigations.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@app/web
 | &gt; Using external babel configuration
 | &gt; Location: &quot;/Users/steida/dev/nberg/packages/web/babel.config.js&quot;
 | [ info ]  bundled successfully, waiting for typecheck results ...
 | [ wait ]  compiling ...
 | [ info ]  bundled successfully, waiting for typecheck results ...
 | [ ready ] compiled successfully - ready on http://localhost:3000
 | [ event ] build page: /
 | [ wait ]  compiling ...
 | [ info ]  bundled successfully, waiting for typecheck results ...
 | [ ready ] compiled successfully - ready on http://localhost:3000
 | { Error: Cannot find module '/Users/steida/dev/nberg/packages/web/.next/server/static/development/pages/_document'
 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
 |     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
 |     at Module.require (internal/modules/cjs/loader.js:637:17)
 |     at require (internal/modules/cjs/helpers.js:22:18)
 |     at Object.loadComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/load-components.js:17:25)
 |     at DevServer.findPageComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:298:40)
 |     at DevServer.renderToHTML (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:313:21)
 |     at DevServer.renderToHTML (/Users/steida/dev/nberg/node_modules/next/dist/server/next-dev-server.js:16:198)
 |     at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
 | [ event ] build page: /next/dist/pages/_error
 | [ wait ]  compiling ...
 | [ ready ] compiled successfully - ready on http://localhost:3000
 | [ error ] { Error: Cannot find module '/Users/steida/dev/nberg/packages/web/.next/server/static/development/pages/_document'
 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
 |     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
 |     at Module.require (internal/modules/cjs/loader.js:637:17)
 |     at require (internal/modules/cjs/helpers.js:22:18)
 |     at Object.loadComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/load-components.js:17:25)
 |     at DevServer.findPageComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:298:40)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:362:35)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next/dist/server/next-dev-server.js:16:706)
 |     at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
 | { Error: Cannot find module '/Users/steida/dev/nberg/packages/web/.next/server/static/development/pages/_document'
 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
 |     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
 |     at Module.require (internal/modules/cjs/loader.js:637:17)
 |     at require (internal/modules/cjs/helpers.js:22:18)
 |     at Object.loadComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/load-components.js:17:25)
 |     at DevServer.findPageComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:298:40)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:362:35)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next/dist/server/next-dev-server.js:16:839)
 |     at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }"><pre class="notranslate"><code class="notranslate">@app/web
 | &gt; Using external babel configuration
 | &gt; Location: "/Users/steida/dev/nberg/packages/web/babel.config.js"
 | [ info ]  bundled successfully, waiting for typecheck results ...
 | [ wait ]  compiling ...
 | [ info ]  bundled successfully, waiting for typecheck results ...
 | [ ready ] compiled successfully - ready on http://localhost:3000
 | [ event ] build page: /
 | [ wait ]  compiling ...
 | [ info ]  bundled successfully, waiting for typecheck results ...
 | [ ready ] compiled successfully - ready on http://localhost:3000
 | { Error: Cannot find module '/Users/steida/dev/nberg/packages/web/.next/server/static/development/pages/_document'
 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
 |     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
 |     at Module.require (internal/modules/cjs/loader.js:637:17)
 |     at require (internal/modules/cjs/helpers.js:22:18)
 |     at Object.loadComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/load-components.js:17:25)
 |     at DevServer.findPageComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:298:40)
 |     at DevServer.renderToHTML (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:313:21)
 |     at DevServer.renderToHTML (/Users/steida/dev/nberg/node_modules/next/dist/server/next-dev-server.js:16:198)
 |     at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
 | [ event ] build page: /next/dist/pages/_error
 | [ wait ]  compiling ...
 | [ ready ] compiled successfully - ready on http://localhost:3000
 | [ error ] { Error: Cannot find module '/Users/steida/dev/nberg/packages/web/.next/server/static/development/pages/_document'
 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
 |     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
 |     at Module.require (internal/modules/cjs/loader.js:637:17)
 |     at require (internal/modules/cjs/helpers.js:22:18)
 |     at Object.loadComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/load-components.js:17:25)
 |     at DevServer.findPageComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:298:40)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:362:35)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next/dist/server/next-dev-server.js:16:706)
 |     at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
 | { Error: Cannot find module '/Users/steida/dev/nberg/packages/web/.next/server/static/development/pages/_document'
 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
 |     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
 |     at Module.require (internal/modules/cjs/loader.js:637:17)
 |     at require (internal/modules/cjs/helpers.js:22:18)
 |     at Object.loadComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/load-components.js:17:25)
 |     at DevServer.findPageComponents (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:298:40)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next-server/dist/server/next-server.js:362:35)
 |     at DevServer.renderErrorToHTML (/Users/steida/dev/nberg/node_modules/next/dist/server/next-dev-server.js:16:839)
 |     at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
</code></pre></div>
<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">We had a working worker file prior to the update to canary, afterwords we get a 'window is undefined' error and the functionality of our worker is never fired or fulfilled. We are already on the canary of <a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-workers">next-workers</a> which has a similar bug fix.</p>
<h2 dir="auto">To Reproduce</h2>
<ol dir="auto">
<li>add <a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-workers">next-workers</a>@canary to next.config.js</li>
<li>import a worker file</li>
<li>see that it loads correctly</li>
<li>upgrade to next@canary</li>
<li>visit the page that loads the worker and see window is undefined error.</li>
</ol>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Expect the worker to load correctly</p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: MacOS</li>
<li>Browser: Firefox and Chrome tested</li>
<li>The version of Next.js: Canary</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Didn't know whether to report here or <a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-plugins">next-plugins</a></p>