-
Notifications
You must be signed in to change notification settings - Fork 41
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
Vite compatibility #66
Comments
@astahmer that's awesome! I'm also thinking of using vite for my project, but apparently vite is in kahoots with emscripten output (or whatever they used for |
I tried forking react-three-flex, using the mentioned PR as base branch and rebasing on The current PR uses The thing is, I do not know how to proceed since the repository of the |
This is mainly to allow usage of yoga-layout-wasm. From now on there's 2 entrpoints, a default one with YogaPrebuiltProvider (which uses yoga-layout-prebuilt) and outerRuntime that exports YogaProvider that allows to pass an arbitrary runtime (that conforms with Yoga types) This is a breaking change because library users will have to place a YogaProvider/YogaPrebuiltProvider in their code Fixes pmndrs#66
Last version is compatible with Vite, since it uses Vite to run the demo |
Hey,
The problem
I was trying to use
@react-three/flex
in avite
based project (instead of the current example that uses CRA) but I landed on multiple issues.**EDIT: Actually I fixed it while writing this, so I guess I should still post it for anyone that is in the same situation.
Scroll to the bottom for the solution. **
Naive installation
Which can be solved either by replacing the string of the problematic file or by adding
<script>window._a = undefined;</script>
in the index.htmlThen there is an issue with
‘@babel/runtime/helpers/esm/extends’
Used in those lines
And I couldn't find a solution for that, so I tried looking for issues/PR and stumbled upon this one #37
yoga wasm PR
Then I
"react-three-flex": "pmndrs/react-three-flex#37/head"
{ find: "@react-three/flex", replacement: "./node_modules/react-three-flex/src/index.ts" },
optimizeDeps: { include: ["@react-three/flex"] },
Which spawns another problem
Something that might be worth noting is that this PR seems quite outdated so that might just be the reason (since i'm getting this log
index.js:1 npm install react-three-fiber is deprecated, use @react-three/fiber instead!
)repro repository here, using the Text component from https://codesandbox.io/embed/7psew
Solution
**EDIT: follow the steps from the
yoga wasm PR
section and then add this file in /public/yoga.wasm **The text was updated successfully, but these errors were encountered: