Error: Cannot find module './lib/source-map-generator' - react-native

I am doing a setup of react native on Mac, After doing everything mentioned in doc when I tried to make a sample project I got this error
node:internal/modules/cjs/loader:1042
throw err;
^
Error: Cannot find module './lib/source-map-generator'
Require stack:
- /Users/macbook/.npm/_npx/7930a8670f922cdb/node_modules/metro-source-map/node_modules/source-map/source-map.js
- /Users/macbook/.npm/_npx/7930a8670f922cdb/node_modules/metro-source-map/src/composeSourceMaps.js
- /Users/macBook/.npm/_npx/7930a8670f922cdb/node_modules/metro-source-map/src/source-map.js
....
....
....

This StackOverflow thread accepted answer suggests removing NodeModules and then running npminstall again:
Error: Cannot find module './lib/source-map-generator'
The same accepted answer comes up in this thread:
https://github.com/terinjokes/gulp-uglify/issues/174
Hope this works for you!

Related

Detox build failed - ':react-native-inappbrowser-reborn:mergeDebugAndroidTestJavaResource'

I have a problem with building tests in detox. It shows me this error:
What went wrong:
Execution failed for task ':react-native-inappbrowser-reborn:mergeDebugAndroidTestJavaResource'.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'META-INF/kotlin-stdlib-jdk8.kotlin_module' from inputs:
- /home/sp/.gradle/caches/transforms-3/4f539c328e5bb19593050e3384e51919/transformed/jetified-kotlin-stdlib-jdk8-1.4.10.jar
- /home/sp/.gradle/caches/transforms-3/c1d521098bb09d070895b1fa3c6468bd/transformed/jetified-kotlin-stdlib-1.8.0.jar
Adding a packagingOptions block may help, please refer to
https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
for more information
I've tried almost everything I found on the forums:
kotlin.stdlib.jdk.variants.version.alignment=false
exclude("META-INF/kotlin-stdlib-common.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk7.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk8.kotlin_module")
exclude("META-INF/kotlin-stdlib.kotlin_module")
exclude("kotlin/annotation/annotation.kotlin_builtins")
exclude("kotlin/collections/collections.kotlin_builtins")
exclude("kotlin/coroutines/coroutines.kotlin_builtins")
exclude("kotlin/internal/internal.kotlin_builtins")
exclude("kotlin/kotlin.kotlin_builtins")
exclude("kotlin/ranges/ranges.kotlin_builtins")
exclude("kotlin/reflect/reflect.kotlin_builtins")
etc...
I got this error after adding: implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) - > in app/build.gradle
I had to add this line because the whole application was not building. After adding this line, the problem discussed above started to appear in detox
Thank you very much for your help

Expo: Unable to resolve module index.ts. None of these files exist

I'm trying out this template located here (https://github.com/t3-oss/create-t3-turbo).
After installing the dependencies, I ran "pnpm dev" in the terminal. Expo gives this error
Error: Unable to resolve module ./index.ts from C:\Users\...\apps\expo/.:
None of these files exist:
* index.ts(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
* index.ts\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
at ModuleResolver.resolveDependency (C:\Users\...\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:153:15)
at DependencyGraph.resolveDependency (C:\Users\...\node_modules\metro\src\node-haste\DependencyGraph.js:276:43)
at C:\Users\...\node_modules\metro\src\lib\transformHelpers.js:171:21
at Server._resolveRelativePath (C:\Users\...\node_modules\metro\src\Server.js:1256:12)
at async Server.requestProcessor [as _processBundleRequest] (C:\Users\...\node_modules\metro\src\Server.js:529:37)
at async Server._processRequest (C:\Users\...\node_modules\metro\src\Server.js:449:9)
index.ts definitely exists in the expo folder. Why is there an error being thrown?
It looks like "main" in the expo folder's package.json is what's throwing this error. I tried changing it to different values, but nothing helped.
Is anyone at least able to confirm they've reproduced the issue? It may be a bug with the template
In case anyone else has this issue, the solution seems to be changing the versions of react and any other libraries that the console suggests.
I was getting a warning for 4 packages that said expo may not work as expected unless these version discrepancies are resolved.
I ignored that because it was my first time with a monorepo, and I thought the versions the template came with would work for everyone. From discussions with others, it seems like it works fine on ios, but not android

Angular flex-layout in Ionic3... rxjs/operator not found?

Trying to use #angular/flex-layout in an existing npm-enabled Ionic 3 project.
Adding "FlexLayoutModule" to my main module's imports won't allow the app to start, saying that: cannot find module "rxjs/operators" is the cause.
Already cleared node_module, npm install, reinstalled Ionic CLI. Nothing helps. Could it be a version conflict? Moreover, I'm already using Observables in this project. I don't get it. And the import of "FlexLayoutModule" is in cause of this issue (disabling the import removes the issue).
Anyone could be successful at using flex-layout with ionic? I've seen this plunk, but it uses system.js, so not 100% reproducing my goal.
http://plnkr.co/edit/y8R0MF?p=info
Edit: a more verbose issue:
Uncaught (in promise): Error: Cannot find module "rxjs/operators"
Error: Cannot find module "rxjs/operators" at Object.580
(http://localhost:8100/build/22.main.js:319:7) at webpack_require
(http://localhost:8100/build/main.js:48:30) at Object.1021
(http://localhost:8100/build/22.main.js:11:79) at webpack_require
(http://localhost:8100/build/main.js:48:30) at
http://localhost:8100/build/main.js:122015:10 at t.invoke
(http://localhost:8100/build/polyfills.js:3:9283) at Object.onInvoke
(http://localhost:8100/build/main.js:4650:37) at t.invoke
(http://localhost:8100/build/polyfills.js:3:9223) at r.run
(http://localhost:8100/build/polyfills.js:3:4452) at
http://localhost:8100/build/polyfills.js:3:14076
I'm getting a similar error with Angular CLI. Everything is OK until I include FlexLayoutModule in the app's NgModule imports. Then I get the error:
Module not found: Error: Can't resolve 'rxjs/operators' in 'D:\dev\Vms.Signup.Client\node_modules\#angular\flex-layout\esm5'
I updated to the latest rxjs and that seems to have fixed it.

Use of undeclared identifier 'UIUserInterfaceIdiomTV'

After installing fbsdk on my React-Native app, I got this error:
Use of undeclared identifier 'UIUserInterfaceIdiomTV'
This is in the file Pods > FBSDKCoreKit > FBSDKOrganicDeeplinkHelper.m
I got this even though I helped a friend doing exactly the same than me, and she didn't get it.
I tried to reinstall everything from scratch to check if the error didn't come from me not using the latest versions, but I still got this error.
A quick fix was to simply delete the case from the the switch (device.userInterfaceIdiom), but I hope someone met this error before or has an idea of where it could come from.
Thank you!
I had the same error. You can fix this error by updating Xcode to the last version, currently 7.3.1.

gapi.auth.authorize: Error: _.Uu is not a function

My web application started to error out yesterday when calling gapi.auth.authorize, and there is no code change. Below is the error stack:
Error: .Uu is not a function
mk#/scs/apps-static/_/js/k=oz.gapi.en.1gq98XyFUlU.O/m=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTPj42_xcRHRghwn4h4H79TdCPg3pw/cb=gapi.loaded_0:234">https://apis.google.com//scs/apps-static//js/k=oz.gapi.en.1gq98XyFUlU.O/m=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTPj42_xcRHRghwn4h4H79TdCPg3pw/cb=gapi.loaded_0:234
qA#/scs/apps-static//js/k=oz.gapi.en.1gq98XyFUlU.O/m=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTPj42_xcRHRghwn4h4H79TdCPg3pw/cb=gapi.loaded_0:236">https://apis.google.com//scs/apps-static//js/k=oz.gapi.en.1gq98XyFUlU.O/m=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTPj42_xcRHRghwn4h4H79TdCPg3pw/cb=gapi.loaded_0:236
.sk#/scs/apps-static/_/js/k=oz.gapi.en.1gq98XyFUlU.O/m=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTPj42_xcRHRghwn4h4H79TdCPg3pw/cb=gapi.loaded_0:238">https://apis.google.com//scs/apps-static//js/k=oz.gapi.en.1gq98XyFUlU.O/m=client/rt=j/sv=1/d=1/ed=1/am=IQ/rs=AItRSTPj42_xcRHRghwn4h4H79TdCPg3pw/cb=gapi.loaded_0:238
Is anyone seeing the same problem? Not sure if Google is making any changes.
Google broke the JS client yesterday. It's being tracked here https://code.google.com/p/google-api-javascript-client/issues/detail?id=103