Repository: next.js
Issue: partytown and `next/script` components with worker strategy absent from DOM (`Warning: __non_webpack_require__ is not defined`)
Labels: Script (next/script)

### Verify canary release

- [X] I verified that the issue exists in Next.js canary release

### Provide environment information

https://stackblitz.com/edit/nextjs-ytg6t8?file=package.json

❯ next info

    Operating System:
      Platform: linux
      Arch: x64
      Version: Ubuntu 20.04.0 LTS Mon May 30 2022 13:05:00 GMT+0200 (Central European Summer Time)
    Binaries:
      Node: 16.14.2
      npm: 7.17.0
      Yarn: 1.22.10
      pnpm: N/A
    Relevant packages:
      next: 12.1.7-canary.23
      react: 17.0.2
      react-dom: 17.0.2

### What browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_

### Describe the Bug

The partytown inline script that initializes partytown and the `next/script` components with strategy worker are absent in the DOM even though the setup instructions for Nextjs + partytown have been performed as described in https://nextjs.org/docs/basic-features/script#off-loading-scripts-to-a-web-worker-experimental.

https://stackblitz.com/edit/nextjs-ytg6t8?file=next.config.js
https://stackblitz.com/edit/nextjs-ytg6t8?file=package.json
https://stackblitz.com/edit/nextjs-ytg6t8?file=pages/_app.tsx

The core of the problem seems to be this: `Warning: __non_webpack_require__ is not defined`

I use a package of mine ([next-safe-middleware](https://github.com/nibtime/next-safe-middleware)) that automatically hashes/nonces the partytown inline script for usage of Nextjs with a strict Content-Security-Policy. 

Possibly the bug has to do with my package, so I would like to find out more about the problem, so I can fix it if it is on my side.

<details>
<summary>Screenshot of the buggy state (<code>yarn add next@canary -E && yarn build && yarn start</code>)</summary>

![2022-05-30 13_49_33](https://user-images.githubusercontent.com/52962482/170986449-73aec491-ac2f-4462-b193-964c0ae53d35.png)

</details>

<details>
<summary>Output of the buggy state (<code>yarn add next@canary -E && yarn build && yarn start</code>)</summary>

```
info  - Collecting page data  
[    ] info  - Generating static pages (0/3)Warning: __non_webpack_require__ is not defined
Warning: __non_webpack_require__ is not defined
Warning: __non_webpack_require__ is not defined
info  - Generating static pages (3/3)
info  - Finalizing page optimization  

Page                                       Size     First Load JS
┌ ○ /                                      2.79 kB        74.7 kB
├   └ css/92ff1f22dd9892a3.css             664 B
├   /_app                                  0 B            71.9 kB
├ ○ /404                                   3.04 kB        74.9 kB
└ λ /api/hello                             0 B            71.9 kB
+ First Load JS shared by all              71.9 kB
  ├ chunks/framework-5f4595e5518b5600.js   42 kB
  ├ chunks/main-08b6be2e4476914b.js        26.6 kB
  ├ chunks/pages/_app-026b9b943408d569.js  1.64 kB
  ├ chunks/webpack-f52887a4bec41a60.js     1.64 kB
  └ css/27d177a30947857b.css               194 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
```

</details>


### Expected Behavior

The partytown init script and the `next/script` components with worker strategy are present in `<head>` of DOM:

<details>
<summary>Screenshot of the expected state (<code>yarn add next@12.1.3 -E && yarn build && yarn start</code>)</summary>

![2022-05-30 13_37_58](https://user-images.githubusercontent.com/52962482/170984629-a8a2656f-2c71-4b11-88d2-9b8b411cae0b.png)


</details>

### To Reproduce

I made a reproduction of the problem context with StackBlitz that uses Google Analytics with worker strategy:
https://stackblitz.com/edit/nextjs-ytg6t8?file=pages/_app.tsx

* run `yarn add next@canary -E && yarn build && yarn start` to observe the bug

* run `yarn add next@12.1.3 -E && yarn build && yarn start` to observe the expected behavior

* run `yarn add next@12.1.4 -E  && yarn build && yarn start` to observe that the bug is present since this version.

Information for seting up Google Analytics with Next and Partytown I got from here: https://dev.to/valse/how-to-add-google-analytics-gtag-to-nextjs-using-partytown-bn4