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

No known conditions for "./compat/server" entry in "preact" package #3057

Closed
chmelevskij opened this issue Mar 12, 2021 · 3 comments · Fixed by #3059
Closed

No known conditions for "./compat/server" entry in "preact" package #3057

chmelevskij opened this issue Mar 12, 2021 · 3 comments · Fixed by #3059

Comments

@chmelevskij
Copy link

I'm using vitejs with custom server in quite large monorepo with typescript, but for single application and keep getting this error:

Error: No known conditions for "./compat/server" entry in "preact" package

every time I switch my branches.

Aliasing is done in similar fashion as in rollup

  resolve: {
    alias: [
      { find: 'react', replacement: 'preact/compat' },
      { find: 'react-dom', replacement: 'preact/compat' },
    ],
  },

And it used to work, but now, I need to tinker around with modules in some quite unpredictable fashion to get it to work 😢

It does work with react.

Reproduction

  "preact": "10.4.8",
  "preact-render-to-string": "^5.1.10",
  "vite": "^2.0.5"

Steps to reproduce

Didn't manage to reproduce in small scale. Will try to look more into this.

Expected Behavior

SSR should load aliased preact.

Actual Behavior

Breaks

@marvinhagemeister
Copy link
Member

marvinhagemeister commented Mar 12, 2021

This issue was resolved with PR #2873 and released as part of Preact version 10.5.8. The current version is 10.5.12. To resolve this issue, please update to the current version of Preact.

@chmelevskij
Copy link
Author

Interesting, I think that pr brakes the vitejs though 😢 I keep getting require is not defined there

@marvinhagemeister
Copy link
Member

Reopening: Sounds like we need to add an esm version.

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.

2 participants