Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Could not resolve "react-dom/server.edge" #119

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

Closed
mai1015 opened this issue Nov 2, 2024 · 6 comments · Fixed by #235
Closed

Could not resolve "react-dom/server.edge" #119

mai1015 opened this issue Nov 2, 2024 · 6 comments · Fixed by #235

Comments

@mai1015
Copy link

mai1015 commented Nov 2, 2024

Im trying to deploy my nextj app but it is not working

package.json

{
    "name": "awesome-project",
    "version": "0.1.0",
    "private": true,
    "scripts": {
        "build:worker": "cloudflare",
        "dev:worker": "wrangler dev --port 8771",
        "preview:worker": "npm run build:worker && npm run dev:worker",
        "deploy:worker": "npm run build:worker && wrangler deploy"
    },
    "dependencies": {
        "next": "^15.0.2",
        "react": "^18.3.1",
        "react-dom": "^18.3.1"
    },
    "devDependencies": {
        "@opennextjs/cloudflare": "^0.2.1",
        "@types/node": "^22",
        "@types/react": "^18",
        "@types/react-dom": "^18",
        "eslint": "^8",
        "eslint-config-next": "15.0.2",
        "next-translate-plugin": "^2.6.2",
        "postcss": "^8",
        "prettier": "^3.3.3",
        "prettier-plugin-svelte": "^3.2.7",
        "prettier-plugin-tailwindcss": "^0.6.8",
        "tailwindcss": "^3.4.1",
        "typescript": "^5",
        "wrangler": "^3.84.1"
    }
}

Im trying to deploy the server with npm run deploy:worker and here is the log

log

✘ [ERROR] Build failed with 1 error:

  ✘ [ERROR] Could not resolve "react-dom/server.edge"
  
  
  .worker-next/.next/standalone/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js:14:16350:
        14 │ ...";e.exports=require("react-dom/server.edge")},path:e=>{"use str...
           ╵                        ~~~~~~~~~~~~~~~~~~~~~~~
  
    The path "./server.edge" is not exported by package "react-dom":
  
      .worker-next/.next/standalone/node_modules/react-dom/package.json:39:13:
        39 │   "exports": {
           ╵              ^
  
  You can mark the path "react-dom/server.edge" as external to exclude it from the bundle, which
  will remove this error. You can also surround this "require" call with a try/catch block to handle
  this failure at run-time instead of bundle-time.

Is there anything I did wrong or it is not related to opennextjs-cloudflare

@vicb
Copy link
Contributor

vicb commented Nov 4, 2024

Next 15 is not supported yet

Also note that we can not debug issues with a repro.

Please re-open this issue (/another) with a repro if you can reproduce on a supported Next version.

@vicb vicb closed this as completed Nov 4, 2024
@jurienhamaker
Copy link

@vicb unsure what you're stating but that pages says:

as well as Next.js 15 when it is released. (currently a release candidate)

@vicb
Copy link
Contributor

vicb commented Nov 6, 2024

The important part is:

@opennextjs/cloudflare is pre 1.0, and still in active development. We intend to support.

N15 is not yet supported.

@sebbean
Copy link

sebbean commented Dec 16, 2024

i'm loooking out for n15 support! i'll keep an eye :-)

@oglassdev
Copy link

oglassdev commented Jan 3, 2025

According to the docs, it appears that they support Next 15. I still appear to be getting this error on Next 15.1.3.

If anyone knows a fix for this or even if the docs could be made clear what versions are fully supported, that would be great.

@oglassdev
Copy link

After a little bit of messing around with it, it appears to be fine with react 19 but not 18

vicb added a commit that referenced this issue Jan 29, 2025
vicb added a commit that referenced this issue Jan 30, 2025
vicb added a commit that referenced this issue Jan 30, 2025
vicb added a commit that referenced this issue Jan 30, 2025
fixup! open-next.config.ts
fixup! format
fixup! remove --inspector-port to avoid collisions
fixup! inspector port
fixup!
fixup! bump timeout again
fixup!
vicb added a commit that referenced this issue Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants