Repository navigation
Description
What happened?
Hi Pascal team,
we are integrating @pascal-app/editor into an external Next.js application and found a browser packaging issue in beta.5.
The public @pascal-app/editor root pulls the Manifold print-export path into the browser dependency graph even when print export is not used.
As a result, an optimized Next/Webpack build fails when it reaches node:module through manifold-3d.
The relevant import chain is:
node:module
→ manifold-3d
→ print-shell-compiler-manifold-core
→ print-shell-compiler-manifold.worker
→ print-shell-compiler-manifold-worker
→ export-manager.tsx
→ @pascal-app/editor root
→ external Next.js application
The build error is:
Module build failed: UnhandledSchemeError:
Reading from "node:module" is not handled by plugins.
The editor APIs and runtime functionality we use otherwise work correctly. The failure is specifically at the optimized browser production-build boundary.
Steps to reproduce
- Consume the public
@pascal-app/editorroot from an external Next.js application. - Use the current beta.5 source.
- Import the editor through its public package entrypoint.
- Run an optimized Next/Webpack production build.
- The browser bundle traverses the print-export dependency path and eventually reaches
node:modulethroughmanifold-3d. - The build fails with
UnhandledSchemeError.
We most recently rechecked exact upstream source SHA:
The issue is still present there.
Expected behavior
The public browser editor entrypoint should be consumable by an external browser application without pulling Node-only dependencies into the browser bundle.
Either of these approaches would solve our integration issue:
- Isolate/lazy-load the print/Manifold implementation so it is not part of the editor browser dependency graph unless print export is actually used.
or
- Expose a supported browser-safe editor/embed package subpath for host applications that need the editor composition APIs but not print export.
For example, a public entrypoint conceptually similar to:
@pascal-app/editor/embed
containing the browser-safe editor surface would also work for us.
Browser & OS
N/A — the failure happens during the optimized Next.js/Webpack production build, before browser runtime.
Screenshots or screen recordings
No response
Additional context
This does not appear to be a general editor/runtime incompatibility.
Our integration checks for the editor API, runtime/client geometry, dimensions, workspace adapter, and ordinary Web tests pass. The blocker is specifically the production browser bundle.
We are currently keeping our production integration pinned to the previous browser-safe Pascal source rather than adding a Webpack node:module shim or importing private @pascal-app/editor/src/... paths.
We would prefer to stay on the supported public Pascal API.
If useful, we would be happy to validate a candidate fix against our external Next.js integration.
Thanks!
Activity
Aymericr commentedon Aug 28, 2026
Thanks — this is real, and the chain you traced is accurate. Two clarifications, then where I land.
First, the version: published
@pascal-app/[email protected]went out on 2026-08-18, and the print export landed on 2026-08-21 in #701. So the npm beta.5 tarball has no manifold in it at all — what you're hitting ismain(yourcfe13068re-test is after both #701 and #703). Worth knowing so you don't chase the wrong artifact.Second, #703 doesn't help you. It only collapsed the print-export UI into a single button; the import chain is unchanged.
export-manager.tsxstill statically imports the manifold worker module, andExportManagerrenders unconditionally from the editor root, so it's in every consumer's graph.Confirmed at
main:[email protected]has nobrowserfield and its.entry is the emscriptenmanifold.jsthat readsnode:module. Webpack statically parses thenew Worker(new URL(...))call and builds that chunk, which is where it dies. Our own builds don't hit it becauseapps/editoris on Next 16 with Turbopack, which tolerates it — that's a real gap in our coverage, not something you're doing wrong.One thing worth flagging: making the import dynamic won't fix this on its own, since webpack still builds the worker chunk either way. The fix has to keep manifold out of the graph entirely — either load it inside the worker through a specifier the bundler can't follow, or ship the browser-safe editor surface as its own entry point. Your
@pascal-app/editor/embedsuggestion is the cleaner of the two and I'd like to go that way, since the package currently exports rawsrc/index.tsxwith no dist boundary to hide anything behind.Yes please to validating a candidate against your integration — I'll ping you here. In the meantime
config.resolve.fallback = { module: false }should unblock a webpack build if you'd rather not stay pinned.smokie40 commentedon Aug 28, 2026
Thanks - sounds good.
Please ping me when you have a candidate and I’ll validate it against our external Next/Webpack integration.
We’ll stay pinned for now rather than add the
resolve.fallbackworkaround, since the current integration is stable and I’d prefer to verify the proper browser-safe boundary once it’s available.And thanks again for looking into this.
Aymericr commentedon Aug 31, 2026
@smokie40 Candidate is up: #735.
The shape, so you can judge it before spending time: the worker chunk is still built by your bundler, but it no longer contains any traceable
manifold-3dspecifier. The core module keeps only a type import; the emscripten factory loads at runtime through animport()webpack can't follow — bare specifier first, then a version-pinned jsDelivr copy ofmanifold.js(the wasm self-resolves relative to the glue's URL). So your build stops seeingnode:moduleentirely, and print export in a bundled browser app runs off the CDN copy unless you pointconfigureManifoldRuntime({ moduleUrl, wasmUrl })at self-hosted assets — that's the new export on the package entry, worth wiring if your deployment is CSP-strict or offline.If you can validate the branch against your external Next/webpack integration, that's the last piece I can't reproduce exactly on my side:
github:pascalorg/editor#fix/manifold-out-of-bundler-graph, or wait for the merge and testmain. What I expect you to see: build passes with zero config, noresolve.fallback, and the worker chunk shrinks by the manifold payload.smokie40 commentedon Aug 31, 2026
Validated the branch against our real external Next.js 16.2.9 / Webpack integration.
A/B on the same consumer, with no
resolve.fallback:67ea40efdf4a03f5897005def56e45189f2c1b69reproduces the originalnode:module/UnhandledSchemeErrorthroughmanifold-3d;58edd0c059991fbebdf597c878d06d53ab79edb0completes the Webpack compilation stage (Compiled with warnings) with neithernode:modulenorUnhandledSchemeError;manifold.jsglue in the same candidate graph is 74,762 bytes; the emitted worker contains nonode:module, so the Manifold payload is no longer bundled into it.So #735 fixes the external-consumer bundler issue we reported, with zero webpack fallback/config on our side.
One separate caveat: our current production fork carries additional BuildBook-specific
ViewerStageAPIs that are not present upstream. After Webpack succeeds, our full Next build currently stops later during TypeScript on that fork/API parity. That is independent of the Manifold packaging fix.From the #715 / #735 packaging side, the candidate is validated from our integration.
fix(editor): keep manifold-3d out of consumer bundler graphs (pascalo…
fix(editor): skip roof support levels in the floorplan export (#847)
fix(cli): preserve configured Mint host origin (#778)
fix(editor): honor millimeter notation across measurement panels (#823)