preactjs / preact

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
https://preactjs.com
MIT License
36.56k stars 1.95k forks source link

Runtime not exported #3465

Closed tw1t611 closed 2 years ago

tw1t611 commented 2 years ago

Describe the bug After the update, I got the following error:

wait  - compiling...
error - ./node_modules/next-mdx-remote/dist/index.js:2:0
Module not found: Package path ./compat/jsx-runtime.js is not exported from package /home/user/Projects/bestnotebook-tech/node_modules/preact (see exports field in /home/user/Projects/bestnotebook-tech/node_modules/preact/package.json)

Import trace for requested module:
./node_modules/next-mdx-remote/index.js
./components/pages/home/MainSection.js
./components/pages/home/Home.js
./pages/index.js

This is my package.json

{
  "private": true,
  "license": "The Unlicense",
  "scripts": {
    "dev": "npx netlify-cms-proxy-server & next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "postbuild": "next-sitemap"
  },
  "dependencies": {
    "amazon-product-api": "^0.4.4",
    "framer-motion": "^6.2.8",
    "next": "^12.1.0",
    "next-mdx-remote": "^4.0.0",
    "next-plugin-preact": "^3.0.6",
    "next-pwa": "^5.4.1",
    "plaiceholder": "^2.2.0",
    "preact": "^10.6.6",
    "preact-render-to-string": "^5.1.19",
    "react": "npm:@preact/compat@^17.0.2",
    "react-dom": "npm:@preact/compat@^17.0.2",
    "react-responsive": "^9.0.0-beta.6",
    "react-ssr-prepass": "npm:preact-ssr-prepass@^1.2.0",
    "react-youtube": "^7.14.0"
  },
  "devDependencies": {
    "@tailwindcss/typography": "^0.5.0-alpha.2",
    "autoprefixer": "^10.4.0",
    "eslint": "^8.5.0",
    "eslint-config-next": "12.1.0",
    "gray-matter": "^4.0.3",
    "netlify-cms-proxy-server": "^1.3.22",
    "next-sitemap": "^2.5.1",
    "postcss": "^8.4.5",
    "postcss-flexbugs-fixes": "^5.0.2",
    "postcss-preset-env": "^7.0.1",
    "sharp": "^0.30.1",
    "tailwindcss": "^3.0.2"
  }

It could somehow depend on next-mdx-remote, but I guess the export is the problem.

To Reproduce

Steps to reproduce the behavior:

  1. Add project with the provided package.json
  2. See error

Expected behavior Should run.

tw1t611 commented 2 years ago

Someone already created an issue in the next-mdx-remote repo. https://github.com/hashicorp/next-mdx-remote/issues/237 Fell free to close this, if it's not fitting here