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 example not working #1006

Closed
vinaypuppal opened this issue Feb 5, 2017 · 4 comments
Closed

preact example not working #1006

vinaypuppal opened this issue Feb 5, 2017 · 4 comments

Comments

@vinaypuppal
Copy link
Contributor

https://github.com/zeit/next.js/tree/master/examples/using-preact
Initially its rendering the content and immediately removing it from DOM. Same happening on every page refresh. No errors on browser console or terminal.

screen shot 2017-02-05 at 10 51 16 pm

@bryanrsmith
Copy link
Contributor

I think this is happening because Next.js is using a babel plugin to explicitly alias react imports: https://github.com/zeit/next.js/blob/ddd93e9865fe3b05ca5d8d473650c8265f3fb5c3/server/build/webpack.js#L176-L178

If I'm understanding correctly, it seems like the server is rendering with React and the client is trying to continue with Preact. If I remove those lines from Next.js the Preact example runs without error.

@bryanrsmith
Copy link
Contributor

That was added in #963. @timneutkens what do you think?

@thangngoc89
Copy link

There is a PR for preact here #767 . But it isn't gonna be merged soon.

@vinaypuppal
Copy link
Contributor Author

just checked with latest version2.0.0-beta.25 and the example seems working fine.

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants