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

preact/compat is missing server.browser.js #3543

Closed
1 task
YunosukeY opened this issue May 17, 2022 · 0 comments · Fixed by #3544
Closed
1 task

preact/compat is missing server.browser.js #3543

YunosukeY opened this issue May 17, 2022 · 0 comments · Fixed by #3544

Comments

@YunosukeY
Copy link

YunosukeY commented May 17, 2022

  • Check if updating to the latest Preact version resolves the issue

Describe the bug
I cannot use Next.js with Preact, since preact/compat is missing server.browser.js.

To Reproduce

Exec following commands.

  1. yarn create next-app --example using-preact using-preact-app
  2. cd using-preact-app
  3. yarn dev

Then,

yarn run v1.22.17
$ next
node:internal/modules/cjs/loader:488
      throw e;
      ^

Error: Cannot find module '/Users/kimitsu/work/using-preact-app/node_modules/react-dom/server.browser.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15)
    at resolveExports (node:internal/modules/cjs/loader:482:14)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/kimitsu/work/using-preact-app/node_modules/next/dist/bin/next:76:30)
    at Module._compile (node:internal/modules/cjs/loader:1101:14) {
  code: 'MODULE_NOT_FOUND',
  path: '/Users/kimitsu/work/using-preact-app/node_modules/react-dom/package.json'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

If you look at package.json, you will see that react-dom has an alias to preact/compat.
Actual react-dom has server.browser.js, but preact/compat does not.

Expected behavior
A server starts with yarn dev, and it works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant