Cant install any sound or image packages for react-native - reactjs

I'm trying to create sound player in my react native app, but I was trying to install a lot of various sound packages, and all of them are giving me pretty same issues, like this:
Without them, project compiles and runs fine.
UPD:
Added arrors as text:
ERROR in ./node_modules/react-native-sound/sound.js
Module not found: Error: Can't resolve 'react-native/Libraries/Image/resolveAssetSource' in '/mnt/c/users/user/desktop/adalo/audio_player/my-component/node_modules/react-native-sound'
# ./node_modules/react-native-sound/sound.js 7:25-83
# ./src/components/CustomAudioPlayer/index.js
# ./index.js
# ./dist/input/runtime.js
ERROR in ./node_modules/react-native/Libraries/Image/resolveAssetSource.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /mnt/c/users/user/desktop/adalo/audio_player/my-component/node_modules/react-native/Libraries/Image/resolveAssetSource.js: Unexpected token, expected "from" (19:12)
17 | const {pickScale} = require('./AssetUtils');
18 |
> 19 | import type {ResolvedAssetSource} from './AssetSourceResolver';
| ^
20 |
21 | let _customSourceTransformer, _serverURL, _scriptURL;
22 |
UPD2:
Running command react-native info

Related

Electron React Boiler Plate (ERB) not working with tailwind

When I follow the Custom Tailwind Config insctructions found here https://electron-react-boilerplate.js.org/docs/styling#without-custom-tailwind-config the app breaks.
I get this error
ERROR in ./node_modules/tailwindcss/tailwind.css (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/tailwindcss/tailwind.css)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
SyntaxError
(2:7) C:\Users\User\leona_repo\SP\tw_bp\your-project-name\node_modules\tailwindcss\tailwind.css Unknown word
1 |
> 2 | import API from "!../style-loader/dist/runtime/injectStylesIntoStyleTag.js";
| ^
3 | import domAPI from "!../style-loader/dist/runtime/styleDomAPI.js";
4 | import insertFn from "!../style-loader/dist/runtime/insertBySelector.js";
# ./node_modules/tailwindcss/tailwind.css 8:6-255 22:17-24 26:7-21 58:25-39 59:36-47 59:50-64 63:6-73:7 64:54-65 64:68-82 70:42-53 70:56-70 72:21-28 83:0-225 83:0-225 84:22-29 84:33-47 84:50-64 61:4-74:5
# ./src/renderer/App.tsx 5:0-34
# ./src/renderer/index.tsx 5:0-24 8:17-20
They said they fixed it in this issue thread but does not work for me
https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/3067

Missing class properties transform - REACT 18 - Create react app

I have a react app created with create-react-app
I have imported a library I created using class syntax
I am getting the following error:
SyntaxError: ....RequestBody.js: Missing class properties transform.
35 |
36 | class RequestBody {
37 | [FIELD_NAMES.INTERFACE_NAME] = "PRE_SALE_CHECK";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 | [FIELD_NAMES.FROM] = "DAVE SHEEPLE";
39 | [FIELD_NAMES.TO] = "MISTER JONES";
40 |
I have tried installing babel-plugin-transform-class-properties
and some other similar suggestions but none worked.
the project itself runs perfectly.
assistance is appreciated

React-beautiful-dnd unexpected token error in package file

I was trying to compile a react program, which includes react-beautiful-dnd. However, I got the following error:
SyntaxError: (path)\node_modules\react-beautiful-dnd\src\state\auto-scroller\can-scroll.js: Unexpected token, expected "," (2:14)
1 | // #flow
> 2 | import { type Position } from 'css-box-model';
| ^
3 | import { add, apply, isEqual, origin } from '../position';
4 | import type { DroppableDimension, Viewport, Scrollable } from '../../types';
5 |
This file is part of the dependency, and it was working perfectly fine until about 30 minutes ago. I have tried reinstalling the package and the error still shows up.

Gatsby fail to compile with flow

I have installed Flow in my Gatsby project, by adding the plugin gatsby-plugin-flow.
It has created a .flowconfig file in project root and a "gatsby-plugin-flow": "^1.0.4" dependency in package.json.
When I run gatsby develop, there is an error :
ERROR in ./src/components/layout.js
Module build failed (from ./node_modules/gatsby/dist/utils/babel-loader.js):
SyntaxError: /Users/iqc/project/src/components/layout.js: Unexpected token, expected "," (10:29)
8 | import "./layout.css"
9 |
> 10 | const Layout = ({ children } : Object) => (
| ^
11 | <StaticQuery
12 | query={graphql`
It looks like Babel is failing to compile the project.
Maybe a problem with ES6 in Gatsby ?
I also tried to install Flow with official docs (no plugin), but the same problem occurs.
Thanks !
You have installed gatsby-plugin-flow, but you also need to add it as a plugin in the gatsby-config.js file.
gatsby-config.js
module.exports = {
plugins: ['gatsby-plugin-flow'],
}

Can't resolve Dart App Engine dependency

I am trying to build a Dart application for Google App Engine but Dart can't resolve any appengine dependency except for the 0.0.1 version. Here is my pubspec.yaml:
name: MyApp
version: 0.0.1
dependencies:
angular2: 2.0.0-alpha.44
browser: ^0.10.0
appengine: '>=0.3.0 < 0.4.0'
transformers:
- angular2:
entry_points: web/main.dart
This is the error I get:
Package appengine has no versions that match >=0.3.0 <0.4.0 derived from:
- MyApp depends on version >=0.3.0 <0.4.0
I have tried every appengine version from https://pub.dartlang.org/packages/appengine/versions but the only one that works is ^0.0.1
Downloading appengine 0.0.1...
Got dependencies!
I would really like to use something newer than 0.0.1. Is something broken or am I missing something?
*Update:
I ran in verbose mode as per Günter Zöchbauer's suggestion and this is the output:
ERR : Package appengine has no versions that match >=0.0.2 <0.4.0 derived from:
| - MyApp depends on version >=0.0.2 <0.4.0
FINE: Exception type: NoVersionException
FINE: package:pub/src/entrypoint.dart 154 Entrypoint.acquireDependencies.<async>
| ===== asynchronous gap ===========================
| dart:async _Completer.completeError
| package:pub/src/entrypoint.dart 199 Entrypoint.acquireDependencies.<async>
| ===== asynchronous gap ===========================
| dart:async _Future.then
| package:pub/src/entrypoint.dart 152 Entrypoint.acquireDependencies.<async>
| ===== asynchronous gap ===========================
| dart:async Future.Future.microtask
| package:pub/src/entrypoint.dart Entrypoint.acquireDependencies
| package:pub/src/command/get.dart 30 GetCommand.run
| package:args/command_runner.dart 178 CommandRunner.runCommand.<fn>
| dart:async Future.Future.sync
| package:args/command_runner.dart 131 CommandRunner.runCommand
| package:pub/src/command_runner.dart 130 PubCommandRunner.runCommand.<async>.<fn>
| dart:async Future.Future.sync
| package:pub/src/utils.dart 103 captureErrors.<fn>
| package:stack_trace Chain.capture
| package:pub/src/utils.dart 117 captureErrors
| package:pub/src/command_runner.dart 130 PubCommandRunner.runCommand.<async>
I expanded the version to include anything between 0.0.2 and 0.4.0 and it fails. It is definitely throwing a no version found error even though I can manually download the versions from the web.
This is a known issue with pub. If it can't resolve a matching set of dependencies it sometimes prints misleading messages.
pub upgrade --verbose
should reveal more information that allows to investigate what dependencies pub is unable to find compatible versions of.
The conflict is the protobuf package.
appengine 0.3.2 depends on protobuf 0.5.0
angular2 2.0.0-alpha.44 depends on protobuf 0.4.2
but angular2 2.0.0-alpha.45 also depends on protobuf 0.5.0
If you change your angular dependency to
angular2: ^2.0.0-alpha.44
or
angular2: 2.0.0-alpha.45
or
angular2: ^2.0.0-alpha
pub can resolve all dependencies just fine.

Resources