-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
Background
This issue is extracted from a comment on an other issue that explain several problem of decap and it's dependencies.
Problem
If you opt for using decap via npm install , opposed to cdn, and your bundler is webpack (next.js uses it), you get this error in the browser runtime on page load of the cms page
Module build failed: UnhandledSchemeError: Reading from "node:url" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Import trace for requested module:
node:url
./node_modules/.pnpm/[email protected]/node_modules/clean-stack/index.js
./node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]__@emotion_a50ca47a6744b7ce5e4028262924054d/node_modules/decap-cms-core/dist/esm/components/UI/ErrorBoundary.js
...
The reason is:
- decap uses
clean-stack
under the hood - clean-stack is a library built with focus on server usage (node)
- clean-stack purpose is not being a browser friendly lib
- clean-stack 5.3.0+ introduced new code that uses
node:url
, and this is not present in browser
Here is the code addition that breaks webpack sindresorhus/clean-stack@7eb47b8
Potential Solution
Short-term:
- fix
clean-stack
at5.2.0
for now (latest version without node:url addition)
Long-term:
- switch to a different library that has the goal of being browser-friendly
martinjagodic, meganfilo, tototjc and danwulff
Metadata
Metadata
Assignees
Labels
No labels