This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Aliasing React to Preact in Deno #4247
Comments
That sounds more like a sandpack issue. My guess is that it doesn't know about |
Maybe. So you're saying that:
in |
With the
|
@rschristian Gotcha, thanks for clarifying. |
@marvinhagemeister @rschristian I think we can close this out. This addressed my question. I'll go ahead and close it but if you want to re-open it, please feel free to of course. |
|
Actually, sorry, I think I moved to close this too soon. Neither:
nor
in In this repo I was able to get Sandpack working with Preact + Vite. That makes me think that Sandpack does in fact work in a Preact app that successfully aliases React to Preact, and that the issue I am having in my Deno app is regarding the above approaches not successfully aliasing React to Preact. To see if this issue is specific to Sandpack or my repo, I tried testing a different library that depends on React (React Bootstrap) in a new Fresh project (repo). I was able to reproduce the issue. routes/index.tsx
deno.json
And I get this error when I run
And this (without the
doesn't work either. So then, it seems that the question of how to alias React to Preact in a Deno project is still an open one. |
This is more of a Deno issue rather than an issue with Preact. At the moment there is no support for deduplicating npm dependencies and aliasing FYI: There is no |
@marvinhagemeister Is there a way to alias |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
There is a section on the Getting Started page called "Aliasing React to Preact". There is no example for how to do this in a Deno project. So 1) I'd like to ask how to do so in a Deno project, and 2) I'd like to propose that a Deno example be added to "Aliasing React to Preact".
Context: I am using Fresh, am trying to use Sandpack, and get the following error when I do. This error is because Sandpack uses React's
useState
and Fresh uses Preact. I think (but am unsure) that what I need to do to resolve this is alias React topreact/compat
.As a guess, I tried doing:
in
imports
indeno.json
but it didn't work.The text was updated successfully, but these errors were encountered: