← Back to context

Comment by aggregator-ios

6 hours ago

This is a good write up on the workings. However, in actual use, Turbopack has severe limitations when compared to Webpack. I’ve been working on https://jsonquery.app and rely on the jq WASM dependency for the queries. But, Turbopack cannot handle importing a WASM binary or the glue code for it directly. The workaround is to have a script copy the binary to the public directory. But that's not all. jq-wasm has a dependency on the ‘fs’ module, even though no fs functions are used. But trying to resolve this in Turbopack is not possible and 2 days of fighting this was a waste of time.

Webpack solved this problem with a few lines in the next.config.ts

For now, I’m back to using Webpack with NextJS 16 with the —Webpack flag. Hope they allow this for future versions.

There are plenty of complaints on the NextJS subreddit, and here is a open thread on complaints with Turbopack https://github.com/vercel/next.js/discussions/77721

Looks the alternative is Rspack?