You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
os is not defined
ReferenceError: os is not defined at [project]/node_modules/decap-cms-app/node_modules/clean-stack/index.js
Workaround
add a local override to bump [email protected] to your package.json:
"overrides": {
"clean-stack": "5.2.0"
}
Proposed Fix
bump clean-stack@^5.2.0 in decap-cms-core
3. Next.js app fails to resolve css
ol/ol.css
codemirror/lib/codemirror.css
codemirror/theme/material.css
Error (with turbopack)
Module [project]/node_modules/ol/ol.css [client] (css) was instantiated because it was required from module [project]/node_modules/decap-cms-widget-map/dist/esm/withMapControl.js [client] (ecmascript), but the module factory is not available. It might have been deleted in an HMR update.
Error (without turbopack):
./node_modules/codemirror/lib/codemirror.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/decap-cms-widget-code/dist/esm/CodeControl.js
Workaround
patch-package and remove the css imports from the packages (see attachments), and manually import them directly in my app:
This isn't specifically related to the esm build changes, but this should help fix React compatibility issues. The current version of react-scroll-sync is not compatible with React 19.
Error
TypeError: this.context.unregisterPane is not a function at ScrollSyncPane.componentWillUnmount
Workaround
add a local override to bump [email protected] to your package.json:
"overrides": {
"react-scroll-sync": "0.11.2"
},
Proposed Fix
bump react-scroll-sync@^0.11.2 in decap-cms-core
The text was updated successfully, but these errors were encountered:
@dragons-library Thanks for raising these and providing the workarounds. These will be useful until we come up with a solution. Note that Decap + React 19 is not officially supported yet, so it's great that we can use your suggestions to make it work.
Just for context, I think the first two are things that "broke" with the 3.5.0 release for anyone that started consuming the esm build of decap-cms-app. The 3rd item probably broke as well, but it might also be somewhat specific to Next.js' build pipeline, though I suspect it will impact anyone without a custom css import rule (I haven't tested this with Vite, parcel, etc).
The 4th item is definitely more specific to React 19 support.
If I have time over the next week or so, I'll try to put together a PR, but if anyone else has the bandwidth and wants to take a stab at it, the above details should be sufficient.
I just bumped
decap-cms-app @ 3.5.0
(from 3.4.0).After the esm fixes, there are a few lingering things that prevent it from fully functioning.
Note: with the below fixes / workarounds, I have
decap-cms-app
working in Next.js with React 19.1.
can't resolve 'slate-hyperscript'
decap-cms-app
does not declare a dependency / peerDependency onslate-hyperscript
, so it fails to resolve (nested dependency fromdecap-cms-core
).Error
Workaround
Proposed Fix
Adding
slate-hyperscript
todecap-cms-app/package.json#peerDependencies
should probably work, but peerDeps are notoriously problematic.2.
[email protected]
is not browser friendly[email protected]
importsos
, which is a node module (node:os
), and not resolved in browser-land. This was fixed and released in[email protected]
.Error
Workaround
add a local override to bump
[email protected]
to yourpackage.json
:Proposed Fix
bump
clean-stack@^5.2.0
indecap-cms-core
3. Next.js app fails to resolve css
ol/ol.css
codemirror/lib/codemirror.css
codemirror/theme/material.css
Error (with turbopack)
Error (without turbopack):
Workaround
patch-package
and remove the css imports from the packages (see attachments), and manually import them directly in my app:Workaround
The esm build output should probably inline the CSS, as there isn't an industry standard for resolving css imports.
4.
[email protected]
is not compatible with React 19This isn't specifically related to the esm build changes, but this should help fix React compatibility issues. The current version of
react-scroll-sync
is not compatible with React 19.Error
Workaround
add a local override to bump
[email protected]
to yourpackage.json
:Proposed Fix
bump
react-scroll-sync@^0.11.2
indecap-cms-core
The text was updated successfully, but these errors were encountered: