-
Notifications
You must be signed in to change notification settings - Fork 15
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
Make compatible for web #9
Comments
Hi @otim, interesting topic. I never did some work "for" react-native-web yet, just used it in some cases. The projects i use matomo-tracker-react-native in are "app only". Making this package work for react-native-web should work, as there is nothing really special "native". We use hooks and fetches at the end. I would setup a basic react native project in the following days with react-native-web enabled, install the package, wrap the main app container to fire a |
Hi @donni106! Thanks for your reply and sharing your thoughts! |
good infos and well done 👍 |
Any update on this, or is there a easy way to exclude the tracking for web. We have an app which is for ios/android and web. Tracking in ios and android works but web wont build. For us it not required that web also support tracking but would be nice if it would build |
can you elaborate a bit? What are you running and what is the failing outcome? Are there logs you can share? |
@donni106 Yes of course, will provide some information this afternoon |
@donni106 When running expo start, and starting the web browser we recieve the following error |
@nickvanboven I was able to reproduce the same error. My research shows up some webpack/babel topics. Can you show you config files used in the project? Which expo version are you using? |
I played around with webpack custom configs but without success. There is a way to merge custom configs in expo webpack configs (webpack.config.js) in the following way:
But as I do not understand the problem exactly at transpiling or something, I could not figure out a correct working custom config yet. Any ideas? |
Sorry, I don't fully understand where you are going with the expo config. For completeness, I am not using expo for my react native build. If I remember correctly, what I concluded was that there is a fundamental difference between how react native and react web projects are built. For react native, dependencies (node_modules) are built from source. This might be done by running It's been a while that I looked into this issue, so I might be mixing up things. Also, I am far from being an expert in all these topics, so I might be using wrong terminology here and there. Sorry about that |
This is something I would need to look up first, never done that before. But it is a good hint, thanks @otim. |
Coming back to this, I achieved running it a few more steps further with:
|
Is your feature request related to a problem? Please describe.
I am working on a react-native-web project. When I naively tried to use this module inside my project I was getting the error:
Support for the experimental syntax 'jsx' isn't currently enabled
Describe the solution you'd like
I think this module is just missing the proper configuration to be used for react-native / react-native-web or classic react
Describe alternatives you've considered
Modules targeted for react web rely on things on
window
and/ordocument
calls. These are not available in react native as far as I know.Additional context
I have tried to come up with a way to compile this module to be used for web. However, I am really lacking the basics here. Nonetheless, if it helps, have a look at my attempt here: https://github.com/otim/matomo-tracker-react-native/tree/feature/react_native_web
The text was updated successfully, but these errors were encountered: