question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to fine tune compilation react-native-paper, remotion & react-native-web

See original GitHub issue

Current behaviour

react-natie-web & remotion setup fails to compile web version.

Expected behaviour

Compiling nicely.

How to reproduce?

  1. Clone https://github.com/RohovDmytro/love-death-react
  2. npm run build

Preview

No screenshots.

What have you tried so far?

I’ve followed the react-native-paper web guide and different variations of loaders, but still no success.

It does not work both with expo or without.

What I find strange is I do make a swap of react-native & react-native-web, but the error still persists with react-native files.

My ‘uneducated guess’ is react-native-paper somehow manages to load react-native files dynamically and they do not get swapped during compilation process. Not sure though.

3000
ERROR in ./node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js 14:12
Module parse failed: Unexpected token (14:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| import requireNativeComponent from '../../Libraries/ReactNative/requireNativeComponent';
> import type {HostComponent} from '../../Libraries/Renderer/shims/ReactNativeTypes';
| import UIManager from '../ReactNative/UIManager';

Your Environment

software version
ios x
android x
react-native 0.70.5
react-native-paper 5.0.0
node 16.16.0
npm or yarn x.x.x
expo sdk x.x.x

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
RohovDmytrocommented, Dec 13, 2022

Root issue found.

So the webpack config must also contain the web.js item AND it should be on top of the list:

extensions: [
        '.web.js',
        ...(other || []),
      ]

It is important to have web.js on top of the array so the libraries (suck as react-native-paper) will prioritize loading web.js files.

Totally worthy adding this to the web support section: https://callstack.github.io/react-native-paper/using-on-the-web.html

1reaction
lukewalczakcommented, Dec 13, 2022

My best guess is react-native-paper should change a way it uses SafeAreaView in case of a build for web. I’ve never read about a special attention devoted to safe area in context of react-native-web build, so I’m not sure it’s a root cause.

If you will have some more findings related to that topic, please collect them in that issue. Currently, I’m busy with other things, so I won’t be able to dive into that area, but the issue will remain open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am getting error, while implementing react-native-paper on ...
After copied PaperProvider I am getting these error.. ERROR in ./src/index.tsx Module not found: Error: Can't resolve 'MaterialCommunityIcons.
Read more >
This Week In React #113: React source code, SOLID, Remix ...
It can help your app to start faster via a pre-compilation in bytecode. With React-Native 0.70 (now in release candidate), Hermes is enabled...
Read more >
sitemap_video.xml - Telerik
KendoReact is a commercial, native (built for React from the ground up) UI ... web functional tests to decrease the risk of script/environment...
Read more >
GitNation People - JavaScript experts, mentors and speakers
Chris is a software developer and independent consultant. He's created web and mobile apps using mostly React and React Native, with Node or...
Read more >
Syntax - Tasty Web Development Treats - Podcast Addict
Syntax - Tasty Web Development Treats - via Podcast Addict | Full Stack ... has SDKs for your favorite frameworks like React, Next.js,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found