Expo npm run ios fails after adding slug - javascript

I have an app made with react-native expo, and i wanted to try and build it so i can set up firebase.
According to expo instructions, i created a project on expo.dev with the same name and added "owner" and "slug" to my app.json file. However, when trying to run "npm run ios" after adding the slug i get this error, which i have no idea what means.
ossible Unhandled Promise Rejection (id: 0):
Error: Directory for 'file:///Users/julz/Library/Developer/CoreSimulator/Devices/22E46E5F-3F35-495D-8E02-C3DDED361E02/data/Containers/Data/Application/7924CAA0-6983-4208-BBD1-EB9F6A2746C9/Library/Caches/ExponentExperienceData/%2540jujasen%252Ftrachi/ExponentAsset-b3263095df30cb7db78c613e73f9499a.ttf' doesn't exist. Please make sure directory '/Users/julz/Library/Developer/CoreSimulator/Devices/22E46E5F-3F35-495D-8E02-C3DDED361E02/data/Containers/Data/Application/7924CAA0-6983-4208-BBD1-EB9F6A2746C9/Library/Caches/ExponentExperienceData/%40jujasen%2Ftrachi' exists before calling downloadAsync.
promiseMethodWrapper#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:20580:45
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:98019:46
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:101458:61
generatorResume#[native code]
asyncGeneratorStep#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:21901:26
_next#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:21920:29
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:21925:14
tryCallTwo#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:26684:9
doResolve#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:26816:25
Promise#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:26703:14
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:21917:25
_downloadAsync#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:101462:32
downloadAsync#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:101450:32
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:100951:67
generatorResume#[native code]
asyncGeneratorStep#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:21901:26
_next#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:21920:29
tryCallOne#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:26676:16
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:26757:27
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:27715:26
_callTimer#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:27630:17
_callReactNativeMicrotasksPass#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:27663:17
callReactNativeMicrotasks#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:27827:44
__callReactNativeMicrotasks#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:20999:46
#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:20799:45
__guard#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:20979:15
flushedQueue#http://192.168.0.107:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false:20798:21
flushedQueue#[native code]
invokeCallbackAndReturnFlushedQueue#[native code]
The slug for my app used to be "Trachi", but since the slug in expo.dev is "trachi" with lowercase i had to change it to that. If i put the old slug with the uppercase T back, the app works without errors again. Does anyone have any idea how i can solve this?

Related

Adding opentelemetry tracing to Node.js app breaks `require("fs").realpathSync.native`

Using the following tracing enabling script from OpenTelemetry docs:
const opentelemetry = require("#opentelemetry/sdk-node");
const { getNodeAutoInstrumentations } = require("#opentelemetry/auto-instrumentations-node");
const { diag, DiagConsoleLogger, DiagLogLevel } = require('#opentelemetry/api');
// For troubleshooting, set the log level to DiagLogLevel.DEBUG
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
const sdk = new opentelemetry.NodeSDK({
traceExporter: new opentelemetry.tracing.ConsoleSpanExporter(),
instrumentations: [getNodeAutoInstrumentations()]
});
sdk.start()
running my Next.js server as I thought is required, I get an error:
$ node --require './tracing/opentelemetry.js' ./node_modules/next/dist/bin/next start -p 3000
No modules instrumentation has been defined, nothing will be patched
#opentelemetry/instrumentation-grpc Module #grpc/grpc-js has been loaded before #opentelemetry/instrumentation-grpc so it might not work, please initialize it before requiring #grpc/grpc-js
Exporter "otlp" requested through environment variable is unavailable.
/mnt/vol/.local/share/pnpm/global/5/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/lib/get-project-dir.js:40
const realDir = _fs.default.realpathSync.native(resolvedDir);
^
TypeError: _fs.default.realpathSync.native is not a function
at Object.getProjectDir (/mnt/vol/.local/share/pnpm/global/5/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/lib/get-project-dir.js:40:50)
at nextStart (/mnt/vol/.local/share/pnpm/global/5/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/cli/next-start.js:80:37)
at /mnt/vol/.local/share/pnpm/global/5/.pnpm/next#12.1.5_zpnidt7m3osuk7shl3s4oenomq/node_modules/next/dist/bin/next:141:34
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Node.js v17.8.0
Now this can be simplified to a minimal reproduction as follows. This has the fs.realpathSync.native function:
$ node -e 'console.log(require("fs").realpathSync)'
[Function: realpathSync] { native: [Function (anonymous)] }
This doesn't have fs.realpathSync.native:
$ node --require ./tracing/opentelemetry.js -e 'console.log(require("fs").realpathSync)'
No modules instrumentation has been defined, nothing will be patched
#opentelemetry/instrumentation-grpc Module #grpc/grpc-js has been loaded before #opentelemetry/instrumentation-grpc so it might not work, please initialize it before requiring #grpc/grpc-js
[Function (anonymous)]
Exporter "otlp" requested through environment variable is unavailable.
My Node's --require is working correctly (noop.js is an empty file):
$ node --require ./tracing/noop.js -e 'console.log(require("fs").realpathSync)'
[Function: realpathSync] { native: [Function (anonymous)] }
Why would the OpenTelemetry setup script break the fs module?
$ node --version
v17.8.0
//package.json dependencies
"#opentelemetry/api": "^1.3.0",
"#opentelemetry/auto-instrumentations-node": "^0.35.0",
"#opentelemetry/sdk-node": "^0.34.0",
$ uname -a
Linux code-server 5.15.0-1025-oracle #31~20.04.2-Ubuntu SMP Tue Nov 29 13:01:56 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Does my ARM machine have something to do with it?
I can reproduce the same on x86_64 on https://replit.com/#JakubKoralewski/opentelemetry-repro with the same behavior.
The reason this error occurs is due to a bug in #opentelemetry/instrumentation-fs introduced as a new dependency to #opentelemetry/auto-instrumentations-node in PR #981 which got released with version 0.34.0. The issue was reported but at the time of writing is still open. However, as also already linked above a PR to address the issue is being reviewed.
Fow now, I see three ways to address the problem:
As suggested in a comment above downgrade #opentelemetry/auto-instrumentations-node to next lower version 0.33.1.
Disable the file system instrumentation when configuring the node instrumentation. For that simply replace getNodeAutoInstrumentations() with getNodeAutoInstrumentations({ '#opentelemetry/instrumentation-fs': { enabled: false } }) in your code. Given that your project is in Next.js and you likely have little file system activity aside from maybe public files this is likely the best option for now.
Remove #opentelemetry/auto-instrumentations-node altogether and simply instrument the libraries you actually use. Using the auto instrumentation for Node.js pulls in a lot of transitive dependencies. Say you have a Next.js app, connect to a Postgres database and use winston for logging your instrumentation setup could look something like this:
const sdk = new opentelemetry.NodeSDK({
traceExporter: new opentelemetry.tracing.ConsoleSpanExporter(),
instrumentations: [
// new FsInstrumentation(), TODO: re-enable once bug is fixed
new HttpInstrumentation(),
new PgInstrumentation(),
new WinstonInstrumentation(),
]
});

React Native: Undefined symbol: _swift_stdlib_isStackAllocationSafe in Xcode

I am getting an error after updating Xcode to 13.3.1 in react native. Before upgrading Xcode app was working fine. Also, I haven't changed anything in code. But still I am getting error. I don't why after updating I am getting this error.
Error: Undefined symbol: _swift_stdlib_isStackAllocationSafe
Undefined symbols for architecture arm64:
"_swift_stdlib_isStackAllocationSafe", referenced from:
function signature specialization <Arg[1] = Owned To Guaranteed> of generic specialization <Swift.String, Swift._NativeSet<Swift.String>> of Swift._NativeSet.genericIntersection<A where A == A1.Element, A1: Swift.Sequence>(A1) -> Swift._NativeSet<A> in libLaunchDarkly.a(FlagChangeNotifier.o)
function signature specialization <Arg[1] = Owned To Guaranteed> of generic specialization <Swift.String> of Swift._NativeSet.intersection(Swift._NativeSet<A>) -> Swift._NativeSet<A> in libLaunchDarkly.a(FlagChangeNotifier.o)
function signature specialization <Arg[1] = Owned To Guaranteed, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[0] = [Closure Propagated : generic specialization <LaunchDarkly.FeatureFlag> of closure #1 (Swift.String) -> Swift.Bool in (extension in LaunchDarkly):Swift.Dictionary< where A == Swift.String>.symmetricDifference(Swift.Dictionary<Swift.String, Any>) -> Swift.Array<Swift.String>, Argument Types : [[Swift.String : LaunchDarkly.FeatureFlag][Swift.String : Any]]> of generic specialization <Swift.String> of Swift._NativeSet.filter((A) throws -> Swift.Bool) throws -> Swift._NativeSet<A> in libLaunchDarkly.a(FlagChangeNotifier.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
react-native": "0.64.2"
Why I am getting this error? And, how can I solve this error?
Have you yet figured this one out? I suspect the Launch Darkly RN SDK is way out of date, as they're still using the older state management form.

TypeError: Cannot read properties of undefined (reading 'getContractFactory') when testing contract

First question so bare with me if it is not very clear, but I'll try my best.
I am currently running through a youtube video to test my contract with hardhat, ethers, and waffle (https://www.youtube.com/watch?v=oTpmNEYV8iQ&list=PLw-9a9yL-pt3sEhicr6gmuOQdcmWXhCx4&index=6).
Here is the contract:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "#openzeppelin/contracts/token/ERC721/ERC721.sol";
contract MyContract is ERC721 {
constructor(string memory name, string memory symbol)
ERC721(name, symbol) {
}
}
And here is test.js:
const { expect } = require('chai');
describe("MyContract", function() {
it("should return correct name", async function() {
const MyContract = hre.ethers.getContractFactory("MyContract");
const myContractDeployed = await MyContract.deploy("MyContractName", "MCN");
await myContractDeployed.deployed();
expect(await myContractDeployed.name()).to.equal("MyContractName");
});
});
when I run "npx hardhat test" in the terminal it returns:
MyContract
1) should return correct name
0 passing (7ms)
1 failing
1) MyContract
should return correct name:
TypeError: Cannot read properties of undefined (reading 'getContractFactory')
at Context.<anonymous> (test\test.js:7:35)
at processImmediate (node:internal/timers:464:21)
My code matches the one from the video, and I am having a tough time understanding why I am getting a TypeError here. Any guidance is much appreciated!
EDIT:
I somehow fixed it, I dont understand how exactly it fixed it but it did. Instead of just installing
npm install #nomiclabs/hardhat-waffle ethereum-waffle chai #nomiclabs/hardhat-ethers ethers
I installed
npm install --save-dev #nomiclabs/hardhat-waffle ethereum-waffle chai #nomiclabs/hardhat-ethers ethers
Then the terminal printed
npm WARN idealTree Removing dependencies.#nomiclabs/hardhat-waffle in favor of devDependencies.#nomiclabs/hardhat-waffle
npm WARN idealTree Removing dependencies.ethereum-waffle in favor of devDependencies.ethereum-waffle
npm WARN idealTree Removing dependencies.#nomiclabs/hardhat-ethers in favor of devDependencies.#nomiclabs/hardhat-ethers
npm WARN idealTree Removing dependencies.ethers in favor of devDependencies.ethers
then I removed the hre in front of ethers.getContractFactory("MyContract") and it worked! If anyone would like to explain why this might have fixed it I'd be happy to read it, otherwise I am moving on.
Add the following code snippet at the top of your hardhat.config.js file
require("#nomiclabs/hardhat-waffle");
Sometimes it is because any of these dependencies below missing. Especially if you are using dotenv file and forgetting to import it. So, put these import statements on your hardhat.config or truffle.config file:
require("#nomicfoundation/hardhat-toolbox");
require("#nomiclabs/hardhat-ethers");
require("dotenv").config();
You needed to import hre in the test code.
const hre = require("hardhat");

Uncaught InvalidData: data did not match any variant of untagged enum ArgsEnum

I'm enthusiastic about Deno so I'm giving it a try. Found a tutorial on building a REST API here.
So, when I'm trying to run it, I get this InvalidData error:
error: Uncaught InvalidData: data did not match any variant of untagged enum ArgsEnum
at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
at async Object.connect ($deno$/net.ts:216:11)
at async Connection.startup (https://deno.land/x/postgres/connection.ts:138:17)
at async Client.connect (https://deno.land/x/postgres/client.ts:14:5)
at async Database.connect (file:///Users/svenhaaf/git/deno/logrocket_deno_api/db/database.js:17:5)
Now, it looks to me that something is wrong when trying to connect to the database, but I can't really figure out what.
What does this InvalidData error mean? How should I fix this?
FYI my deno --version prints:
deno 0.42.0
v8 8.2.308
typescript 3.8.3
Code:
I cloned the repo from https://github.com/diogosouza/logrocket_deno_api, and in config.js, I edited line 1 from const env = Deno.env() to const env = Deno.env, since it looks like Deno.env became an object instead of a method.
The tutorial is not using versioned URLs, and deno-postgres version that is being used is not compatible with v0.42.0, since https://deno.land/x/postgres/mod.ts is pulling from master
Change db/database.js to import from https://deno.land/x/postgres#v0.3.11/mod.ts, since v0.3.11 is the correct version for Deno v0.42.0
import { Client } from "https://deno.land/x/postgres#v0.3.11/mod.ts";
Remember to always use the version in the URL if you don't want the code to stop working when a new Deno or package version is released.

VueJS Grpc-Web module not found

I've created a fresh VueJS application with TypeScript functionality.
When I generate using:
protoc -I=. service.proto --js_out=import_style=typescript:. --grpc web_out=import_style=typescript,mode=grpcwebtext:.
I get the following files:
When I move them to src/_protos in my VueJS project and try to import { PlatformClient } from '#/_protos/ServiceServiceClientPb'; it gives me the following error:
Failed to compile.
./src/_protos/ServiceServiceClientPb.ts
Module not found: Error: Can't resolve './service_pb' in '/Users/theobouwman/dev/woodyshousing/woody_web/src/_protos'
Why is this?
I believe this is resolved in https://github.com/grpc/grpc-web/issues/431.
In short, --js_out=import_style=typescript:. is not supposed to work. You need to do --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:.

Categories