Comments (6)
You will need to polyfill it
from expo-next-monorepo-example.
I'm using raf to polyfill, but I'm gonna try a different setup
from expo-next-monorepo-example.
I did try a different setup but didn't manage to make it work yet:
import { FC } from 'react';
import AppWrapper from 'app/app/app.wrapper';
import type { AppProps } from 'next/app';
import 'raf/polyfill';
// @ts-ignore
global.setImmediate = requestAnimationFrame;
import 'setimmediate';
const App: FC<AppProps> = ({ Component, pageProps }) => {
return (
<AppWrapper>
<Component {...pageProps} />
</AppWrapper>
);
};
export default App;
When I use like this it gives me this error: TypeError: global.__reanimatedWorkletInit is not a function
import { FC } from 'react';
import 'react-native-reanimated';
import AppWrapper from 'app/app/app.wrapper';
import type { AppProps } from 'next/app';
import 'raf/polyfill';
// @ts-ignore
global.setImmediate = requestAnimationFrame;
import 'setimmediate';
const App: FC<AppProps> = ({ Component, pageProps }) => {
return (
<AppWrapper>
<Component {...pageProps} />
</AppWrapper>
);
};
export default App;
If I use also import 'react-native-reanimated';
like above, it gives me this error: ReferenceError: requestAnimationFrame is not defined
The weird thing is that when I was testing without a monorepo, It worked.
from expo-next-monorepo-example.
It needs to be before the import of react-native-reanimated (or any import that has react-native-reanimated as a sub dependency).
from expo-next-monorepo-example.
Trying it here, but it seems to be back to TypeError: global.__reanimatedWorkletInit is not a function
:
TypeError: global.__reanimatedWorkletInit is not a function
at eval (webpack-internal:///../../node_modules/react-native-gesture-handler/lib/commonjs/handlers/gestures/gestureStateManager.js:148:12)
at eval (webpack-internal:///../../node_modules/react-native-gesture-handler/lib/commonjs/handlers/gestures/gestureStateManager.js:151:4)
at Object.../../node_modules/react-native-gesture-handler/lib/commonjs/handlers/gestures/gestureStateManager.js (/home/daniel/projects/labook/packages/web/.next/server/pages/_app.js:5833:1)
at __webpack_require__ (/home/daniel/projects/labook/packages/web/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///../../node_modules/react-native-gesture-handler/lib/commonjs/handlers/gestures/GestureDetector.js:42:28)
at Object.../../node_modules/react-native-gesture-handler/lib/commonjs/handlers/gestures/GestureDetector.js (/home/daniel/projects/labook/packages/web/.next/server/pages/_app.js:5756:1)
at __webpack_require__ (/home/daniel/projects/labook/packages/web/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///../../node_modules/react-native-gesture-handler/lib/commonjs/index.js:213:24)
at Object.../../node_modules/react-native-gesture-handler/lib/commonjs/index.js (/home/daniel/projects/labook/packages/web/.next/server/pages/_app.js:5943:1)
at __webpack_require__ (/home/daniel/projects/labook/packages/web/.next/server/webpack-runtime.js:33:42)
So, now I'm not sure if this error is fixed with import 'react-native-reanimated'
.
from expo-next-monorepo-example.
I think I've missed some settings. I did manage to work!
from expo-next-monorepo-example.
Related Issues (20)
- Error: You may need an appropriate loader to handle this file type HOT 9
- TypeError: Cannot call a class as a function HOT 4
- Back button `pop` logic race condition HOT 13
- `as` path doesn't work properly (or does it?) HOT 1
- Shallow routing example HOT 5
- next-images TypeError: unsupported file type: undefined HOT 3
- example of path alias in the project? HOT 5
- Thinking through `parse`-ing query parameters HOT 1
- Don't use the same screen `name` in multiple stacks
- Icons & Images don't work... HOT 2
- VSCode Intellisense HOT 2
- Remix.run integration as alternative to Next? HOT 2
- Better app.config.ts HOT 4
- Adding navigation HOT 1
- Expo publish not working properly HOT 2
- Problems runnning expo HOT 2
- Support for Expo 44 HOT 1
- Delete yarn.lock and then run yarn install. The next.js would fail to run... HOT 5
- Using NextJS API Routes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expo-next-monorepo-example.