blitz-js / next-superjson-plugin

SuperJSON Plugin for Next.js Pages and Components
198 stars 13 forks source link

out of bounds memory access #32

Closed cellulosa closed 1 year ago

cellulosa commented 1 year ago

Describe the bug

I get a out of bounds memory access on 0.4.2:

thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/node_modules/next/dist/client/dev/amp-dev.js")'

Caused by:
    0: failed to invoke `/node_modules/next-superjson-plugin/next_superjson.wasm` as js transform plugin at /node_modules/next-superjson-plugin/next_superjson.wasm
    1: RuntimeError: out of bounds memory access
           at <unnamed> (<module>[329]:0x62a25)
           at <unnamed> (<module>[355]:0x6bd6b)
           at <unnamed> (<module>[357]:0x6d15e)
           at <unnamed> (<module>[41]:0xc3fb)
           at <unnamed> (<module>[105]:0x1cf8d)
           at <unnamed> (<module>[158]:0x343b0)
           at <unnamed> (<module>[183]:0x3c8ce)
           at <unnamed> (<module>[124]:0x2332b)
           at <unnamed> (<module>[751]:0xd2250)
           at <unnamed> (<module>[750]:0xd1fe1)
           at <unnamed> (<module>[589]:0xaf798)
    2: heap_get_oob', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    31891 bus error  npm run dev

If I add RUST_BACKTRACE=1 to my .zshrc it simply returns:

[1]    32614 bus error  npm run dev

Expected behavior

Run without failure

Reproduction link

No response

Version

0.4.2

Config

No response

Additional context

MacBook Pro (Retina, 15-inch, Mid 2015) MacOS 12.6

orionmiz commented 1 year ago

Have you checked this? https://github.com/blitz-js/next-superjson-plugin/issues/31#issuecomment-1250126228

--legacy-peer-deps option just ignores the version of peer dependency.

cellulosa commented 1 year ago

Have you checked this? #31 (comment)

--legacy-peer-deps option just ignores the version of peer dependency.

Aye! It works on next@canary! Thank you @orionmiz