Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency issues in Next.js 14+ #2240

Open
armannaj opened this issue Feb 22, 2024 · 6 comments
Open

Dependency issues in Next.js 14+ #2240

armannaj opened this issue Feb 22, 2024 · 6 comments
Labels
type: bug 🪲 Something isn't working

Comments

@armannaj
Copy link

Summary

I was using remirror 2 successfully with Nextjs 13. But when I upgrade it to Nextjs 14, I start getting these errors:
./node_modules/domino/lib/sloppy.js
With statement are not allowed in strict mode

I understand that this is an issue of domino npm package. This issue has been discussed on domino repo here and more specifically for Nextjs here

Steps to reproduce

  1. Create Nextjs 14 app
  2. Add remirror
  3. Compile and run

Expected results

Maybe remove/replace this dependency as it seems to be an old/deprecated package (last publish 4 years ago)

Actual results

./node_modules/domino/lib/sloppy.js
Error: 
  × With statement are not allowed in strict mode

Possible Solution

Open to suggestions.

Screenshot(s)

N/A

@armannaj armannaj added the type: bug 🪲 Something isn't working label Feb 22, 2024
@armannaj armannaj changed the title Dependency issues with Next.js 14+ Dependency issues in Next.js 14+ Feb 22, 2024
@guidsen
Copy link

guidsen commented Feb 26, 2024

Same here. Migrating to NextJS 14 in combination with turndown package is making our lives really hard

@huuthanit
Copy link

@guidsen just a hotfix but I can solve this issue by using the fork of Haringat/domino

This is the patch file
domino+2.1.6.patch

@shuowu
Copy link

shuowu commented Mar 3, 2024

Workaround:

add resolutions/overrides to package.json to point domino to the fork mentioned in #2240 (comment)

resolutions: {
    "domino": "git://github.com/Haringat/domino#2721294c75334ece635dfc72cad0a3dede7391fb"
}

@ocavue
Copy link
Member

ocavue commented Mar 5, 2024

Remirror itself doesn't depend on domino. @remirror/extension-markdown depends on turndown, and turndown is using domino.

For Remirror, one option is to migrate turndown into something else. unified ecosystem (including rehype-remark etc.) seems to be a good alternative. However, unified packages are ESM-only and Remirror is ESM-CJS-dual, thus we cannot use unified packages. Any recommendations are welcome.


If you're seeing this issue and you're not using the markdown future from Remirror, a workaround would be uninstalling the remirror package and installing underlay @remirror/* packages instead. Here is an example:

// package.json
  dependencies: {
-    "remirror": "^2.0.39"
+    "@remirror/extension-heading": "^2.0.14"
+    "@remirror/extension-tables": "^2.4.1"
+    "@remirror/react": "^2.0.35"
  }
// editor.ts
- import { HeadingExtension, TableExtension } from 'remirror/extensions';
- import { Remirror, useRemirror } from 'remirror/react';
+ import { HeadingExtension } from '@remirror/extension-heading';
+ import { TableExtension } from '@remirror/extension-tables';
+ import { Remirror, useRemirror } from '@remirror/react';

By doing that, you can avoid @remirror/extension-markdown, turndown and domino in your dependencies.

@armannaj
Copy link
Author

armannaj commented Apr 9, 2024

Thanks for all the responses.

I just upgraded to Next.js 14.1.4 and it seems like it's working fine even without the solutions mentioned here.

@Seolhun
Copy link

Seolhun commented Apr 10, 2024

The same thing happens to me.
I found the commit and log 'Removes 'domino' from the codebase.' in ChangeLog.
I doesn't understand where the domino dependencies are in Remirror for now.

I followed your suggestion(#2240 (comment)) and migrated all dependencies of remirror extension, but the result was the same. Even remirror only installed react.

By doing that, you can avoid @remirror/extension-markdown, turndown and domino in your dependencies.

https://remirror.io/docs/showcase/markdown in Showcase documentation, we find the remirror markdown eidtor need MarkdownExtension. however, how to avoid @remirror/extension-markdown dependencies that issue?


I shared my solution.
There are big different version about major 3 between remirror markdown extension and turndown-plugin-gfm

  "resolutions": {
    "domino": "git://github.com/Haringat/domino#2721294c75334ece635dfc72cad0a3dede7391fb",
    "turndown": ">=7" 
  },

My tsup bundler was passed, I will test this issues in runtime on my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants