vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.48k stars 27.04k forks source link

Embedded Sinity studio failed to start after deploy the application #55878

Open rodolfostark opened 1 year ago

rodolfostark commented 1 year ago

Link to the code that reproduces this issue

https://github.com/rodolfostark/portfolio

To Reproduce

  1. Access https://portfolio/
  2. Navegate to https://portfolio/studio

Current vs. Expected behavior

After deploy the application the sanity studio can't be accessed throwing 500 Internal Server Error.

image

But locally the studio just works fine when i navegate to http://localhost:3000/studio

270118092-f57ad44a-f888-4b66-9a18-6d2815d5ec1b

Verify canary release

Provide environment information

Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Home Single Language
    Binaries:
      Node: 18.17.1
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.19
      eslint-config-next: 13.4.19
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

Static HTML Export (output: "export")

Additional context

Locally the access just works fine, but after deploying it and try to access the studio the application return this error

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server.edge' is not defined by "exports" in /var/task/node_modules/react-dom/package.json at new NodeError (node:internal/errors:405:5) at exportsNotFound (node:internal/modules/esm/resolve:364:10) at packageExportsResolve (node:internal/modules/esm/resolve:700:9) at resolveExports (node:internal/modules/cjs/loader:567:36) at Module._findPath (node:internal/modules/cjs/loader:636:31) at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27) at /var/task/node_modules/next/dist/server/require-hook.js:110:36 at Module._load (node:internal/modules/cjs/loader:922:27) at e.<computed>._module.Module._load (/var/task/___vc/__launcher.js:15:1964) at Module.require (node:internal/modules/cjs/loader:1143:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED', page: '/studio' } Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server.edge' is not defined by "exports" in /var/task/node_modules/react-dom/package.json at new NodeError (node:internal/errors:405:5) at exportsNotFound (node:internal/modules/esm/resolve:364:10) at packageExportsResolve (node:internal/modules/esm/resolve:700:9) at resolveExports (node:internal/modules/cjs/loader:567:36) at Module._findPath (node:internal/modules/cjs/loader:636:31) at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27) at /var/task/node_modules/next/dist/server/require-hook.js:110:36 at Module._load (node:internal/modules/cjs/loader:922:27) at e.<computed>._module.Module._load (/var/task/___vc/__launcher.js:15:1964) at Module.require (node:internal/modules/cjs/loader:1143:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED', page: '/studio' } RequestId: f726c18b-dc84-4e89-9ffb-aba6a467f0ad Error: Runtime exited with error: exit status 1 Runtime.ExitError

my package.json and sanity configs are just as follows:

{
  "name": "portfolio",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@types/node": "20.6.2",
    "@types/react": "18.2.21",
    "@types/react-dom": "18.2.7",
    "autoprefixer": "10.4.15",
    "eslint": "8.49.0",
    "eslint-config-next": "13.4.19",
    "next": "13.4.19",
    "next-sanity": "^5.5.3",
    "postcss": "8.4.29",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-icons": "^4.11.0",
    "sanity": "^3.16.7",
    "tailwindcss": "3.3.3",
    "typescript": "5.2.2"
  },
  "devDependencies": {
    "@portabletext/react": "^3.0.7"
  }
}
dx66668 commented 6 months ago

I got the same err,do you resolve it?