Repository: next.js
Issue: Error when adding FormatJS SWC Plugin
Labels: SWC

### Link to the code that reproduces this issue

https://github.com/rubanooo/next-swc-formatjs-error

### To Reproduce

1. Install the SWC plugin
2. Add to the next config with the following format:
```ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  /* config options here */
  experimental: {
    swcPlugins: [
      ['@swc/plugin-formatjs', {}]
    ]
  }
};

export default nextConfig;
```
3. Run the dev server

### Current vs. Expected behavior

Following the 3 steps, I expect the server to not panic at least

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.2.0: Fri Dec  6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.14.0
  npm: 10.7.0
  Yarn: N/A
  pnpm: 9.15.2
Relevant Packages:
  next: 15.1.5 // Latest available version is detected (15.1.5).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: N/A
Next.js Config:
  output: N/A
```

### Which area(s) are affected? (Select all that apply)

SWC

### Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local)

### Additional context

The error message when using turbopack:

```
Panic: panicked at turbopack/crates/turbopack-swc-utils/src/emitter.rs:52:13:
IssueCollector and IssueEmitter were dropped without calling `collector.emit().await?`
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   2: _napi_register_module_v1
   3: _napi_register_module_v1
   4: _napi_register_module_v1
   5: _napi_register_module_v1
   6: _napi_register_module_v1
   7: _BrotliDecoderVersion
   8: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: _BrotliDecoderVersion
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: _napi_register_module_v1
  23: _napi_register_module_v1
  24: _napi_register_module_v1
  25: _napi_register_module_v1
  26: _napi_register_module_v1
  27: _napi_register_module_v1
  28: _napi_register_module_v1
  29: _napi_register_module_v1
  30: _napi_register_module_v1
  31: _napi_register_module_v1
  32: _napi_register_module_v1
  33: _napi_register_module_v1
  34: _napi_register_module_v1
  35: __pthread_deallocate

```


The error message when not using turbopack:

```
Panic: panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-5.0.2/src/plugin.rs:169:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/ruben/Code/tosize/next-swc-formatjs-error/src/app/layout.tsx")'

Caused by:
    0: failed to invoke `/Users/ruben/Code/tosize/next-swc-formatjs-error/node_modules/.pnpm/@swc+plugin-formatjs@2.0.6/node_modules/@swc/plugin-formatjs/swc_plugin_formatjs.wasm` as js transform plugin at /Users/ruben/Code/tosize/next-swc-formatjs-error/node_modules/.pnpm/@swc+plugin-formatjs@2.0.6/node_modules/@swc/plugin-formatjs/swc_plugin_formatjs.wasm
    1: wasm plugin bytecheck failed "check bytes error: check failed for tuple struct member 0: check failed for struct member pkg_version: pointer out of bounds: base 0x4c246060b98 offset -51922 not in range 0x4c246060a00..0x4c246060bb4"
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   2: _napi_register_module_v1
   3: _napi_register_module_v1
   4: _napi_register_module_v1
   5: _napi_register_module_v1
   6: _napi_register_module_v1
   7: _napi_register_module_v1
   8: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: <unknown>
  11: <unknown>
  12: _BrotliDecoderVersion
  13: _BrotliDecoderVersion
  14: _BrotliDecoderVersion
  15: _BrotliDecoderVersion
  16: _BrotliDecoderVersion
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>

---------------------------
Panic: panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-5.0.2/src/plugin.rs:169:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/ruben/Code/tosize/next-swc-formatjs-error/node_modules/.pnpm/next@15.1.5_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/pages/_app.js")'

Caused by:
    0: failed to invoke `/Users/ruben/Code/tosize/next-swc-formatjs-error/node_modules/.pnpm/@swc+plugin-formatjs@2.0.6/node_modules/@swc/plugin-formatjs/swc_plugin_formatjs.wasm` as js transform plugin at /Users/ruben/Code/tosize/next-swc-formatjs-error/node_modules/.pnpm/@swc+plugin-formatjs@2.0.6/node_modules/@swc/plugin-formatjs/swc_plugin_formatjs.wasm
    1: wasm plugin bytecheck failed "check bytes error: check failed for tuple struct member 0: check failed for struct member pkg_version: pointer out of bounds: base 0x4c248081198 offset -51922 not in range 0x4c248081000..0x4c2480811b4"
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   2: _napi_register_module_v1
   3: _napi_register_module_v1
   4: _napi_register_module_v1
   5: _napi_register_module_v1
   6: _napi_register_module_v1
   7: _napi_register_module_v1
   8: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: <unknown>
  11: <unknown>
  12: _BrotliDecoderVersion
  13: _BrotliDecoderVersion
  14: _BrotliDecoderVersion
  15: _BrotliDecoderVersion
  16: _BrotliDecoderVersion
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
```