text:
generate pangram exercise

I wasn't sure if I should be including the generated files, modifying config.json, or starting the version at 1 or 0.
Also, I hard coded single quotes around the inputstring read from the common repo... which kind of sucks as it could break later if someone includes an input string with apostrophes or special symbols.

Why not use the %q() syntax to alleviate the worry?

Mostly I wanted to bring it up as a disclaimer of sorts.
I left input in single quotes because:

its working now and YAGNI
%Q(...) might be confusing to the novice Rubyist
nothing trivial will be perfect:

q% doesn't handle escaped characters (newline, etc.)
%Q() could still fail if parens are mismatched in input

I also looked around the repo and it looks like everything else that is generated uses single quotes to delineate string literals.
That said, if there is a desire not to use single quotes, I'd be more than happy to change it up. Just let me know.

I wasn't sure if I should be including the generated files, modifying config.json, or starting the version at 1 or 0.

I'd say: "yes" include the generated files, and "yes" modify the config.json, and start the version at 1.
The generated files are what get delivered when people say "exercism fetch", the generators themselves are just kept in the repo for our own benefit.

I think that this is far enough along in the track that it's OK to use %Q(). I wonder if there's a way of using %Q in the generator, and then producing a correctly escaped string that uses double-quotes.

I think that this is far enough along in the track that it's OK to use %Q(). I wonder if there's a way of using %Q in the generator, and then producing a correctly escaped string that uses double-quotes.

Sorry, I'm a bit confused. What do we want a user to see in the test file? It sounds like we are saying both %Q(...) and "...".

I think the tests should be idiomatic ruby, regardless of the skill level of the coder.  It doesn't matter if they have seen it yet or not, they will, and this project should be held to that standard.
The tests will, by behavior, validate the solution.  Feel free to use the %Q and related methods, they make sense and there is no reason not to expose them, especially if they should be used.

:+1: I will use %Q(...) syntax and put a small comment in to help alleviate any initial confusion.

I think the tests should be idiomatic Ruby, regardless of the skill level of the coder. It doesn't matter if they have seen it yet or not, they will

Yes, this is a good point. I agree.

I appear to have angered rubocop :laughing:

I disagree with those cops. @kotp what do you think? Should we ease up on the rubocop there?

I agree with the cops, specifically, here we have no case where a string is using both single and double quotes in the string itself, and no string where interpolation is being used.
And so, take the cops advice, and use the syntax as shown, or simply use the 'simple' string in the example of a string that you want to include double quoted strings inside.
I prefer the use of the plain quoting in almost every case.  The exception is when you have a "String that may hold " and ' characters inside".  Then this will use the %q() syntax, and when you have "a String that will do some #{calculations_and_interpolation} in conjunction with ' and " characters" then you use the %Q() syntax.

@kotp The %Q is from the generator programmatically running each input from the x-common repo in an each loop.
I think we have miscommunicated around its use. Initially I had it using single quotes, but remarked this was being done blindly and could lead to errors later if single quotes are used in strings (from the x-common repo).
After some discussion, I thought it was preferred to use %Q(...) instead of '...' when programatically generating pangram_tests.rb as it was less likely to break on future inputs.
I actually agree that seeing the %Q here looks pretty odd. Should I revert those changes and go with only the changes in the first commit?

@kotp and I decided that going back to single quotes was a good solution. If single quotes become a problem we can fix that bridge if we come to it.

OK, thanks for taking the time to go back and forth on this so we could figure out how to best go about it.

@Cohen-Carlisle was right to put the little party horn on there, as it was a pair programming party! :balloon:

authors: Cohen-Carlisle kotp kytrinyx

repo: exercism/xruby


text:
Disabled HTTPS

Hello again,
I receive a ERR_CONNECTION_REFUSED when I try to access pathfinder (Probably because I don't have mod_ssl enabled, and I don't want to enable it, plus I don't have a certificate to use with it)
Is there any way to disable HTTPS in pathfinder ? (I even tried commenting out some rewrite rules but it keeps redirecting me to HTTPS, you probably hardcoded it :/ )
Thanks.

Please check .htaccess https://github.com/exodus4d/pathfinder/blob/master/.htaccess L.10-16. It is not "hardcoded" :). I expect anyone who is installing a copy of Pathfinder to edit this file, to get it to work in his environment.
Using SSL is recommended. Ill add a hint in the wiki. Thanks for reporting.

As I said, I tried commenting the lines but it keeps redirecting me to HTTPS. I even tried REMOVING the .htaccess file and I got redirected to https again...

Did you try removing history or in incognito? It's very possible your browser remembers that it redirects to https.
—
Sent from Mailbox
On Wed, Sep 23, 2015 at 12:05 PM, Sakarias Longhorn
notifications@github.com wrote:

As I said, I tried commenting the lines but it keeps redirecting me to HTTPS. I even tried REMOVING the .htaccess file and I got redirected to https again...
Reply to this email directly or view it on GitHub:
https://github.com/exodus4d/pathfinder/issues/26#issuecomment-142553151

I cleared my browser's cache, now I just get a ERR_NAME_NOT_RESOLVED, So I created an A RECORD pointing to www (I think that's the cause, correct me If I'm wrong), I'm waiting for the record to be created now, and i'll report after.

Do not remove them. They are necessary, otherwise the Framework can´t redirect URLs back to the index.php. The index.php works as a dispatcher for any Ajax URL that is called.
This is how it works: http://fatfreeframework.com/routing-engine#sample-apache-configuration
There is no "HTTPS (on/off) switch in the config. But yeah changes to the .htaccess need a complete history clean in your browser. And even than i have sometimes problems to get new changes to work. I´ll do a fresh installation (without SSL) this weekend and check it.

Ok, I'll try to get it to work on my end for now,
Also~ In the installation instructions, at the cron tab part, what cron do I need to add exactly ? (I'm not very familiar with cron jobs, and it says to trigger /cron but.. I don't see that folder in the installation folder.)

EDIT Looks like my virtualhost file is the problem...
When I access pathfinder.polaris-industries.com
.htaccess redirects me to www.pathfinder.polaris-industries.com
and I get ERR_NAME_NOT_RESOLVED
000-default.conf

DNS Zones

Ok so, definitely a cache issue, it's working now... well, I can get to the page but it says 500 Internal Error. (white page)

/cron cron is no folder or any physically script that should be triggered by a Cronjob. It is just a virtual URL, known to Pathfinder (like all the other Ajax URLs in this project). You just have to trigger that URL by a cronjob. If you are on a shared hoster and there is no option to configure Cronjobs (check the Admin interface,...) you will probably switch to a 3rd party Cronjob hoster (e.g. https://www.setcronjob.com/) and configure that path as a Cronjob.
The Script that will be executed behind /cron will then decide which other Cronjob should be executed. For example, some Script should run each hour. That means, that the executed Script (/Cron) will poke an other Script every 60th time. You don´t have to worry about this tasks, they are configures in the cron.ini don´t touch them if you dont know what you are doing.
More Information about the Cron-Extension I use:
https://github.com/xfra35/f3-cron

Ok thanks, I'm reading that, so if I understand correctly I need to :
Create a cron.php somewhere in my /www containing

exec('wget -qO- /dev/null [YOUR INSTALLATION]/cron &> /dev/null', $out, $result);
echo "start:";
echo "Returncode: " .$result ."";
echo "Ausgabe des Scripts: " ."";
echo ""; print_r($out);

and add a cron job like so

php-cli -f /var/www/cron.php

Is it correct ? If yes, should I run the script every minute/hours/days ?
Thanks a lot.

No all you have to do is to "simulate" "someone" that calls the URL http://www.[Your Project]/cron every minute. You cant do that with PHP. e.g. an endless loop wont work (time out problem).
So no one wants to call that URL manually :) So you need an other way to trigger that URL. That is usually done by a Cronjob Configuration. There are many ways to do that. A easy way will probably a 3rd party hoster just for that cronjob (see post above).

I added that one

wget -O - http://www.pathfinder.polaris-industries.com/cron/cron.phpx /dev/null 2>&1

cron.phpx is empty btw, is it good enough ?

Everything is working, so when we look at the error.log we can see

Table 'galatea.mapsolarsystems' doesn't exist
So, I just went to phpmyadmin and checked the tables... they were named for example :
invType
mapSolarSystems
(Notice the capital letters), that's why it wasn't working, but I used the table you provided so.. did I do something wrong when I imported the tables ?

Glad it's working now ! Good job and thanks for your patience.

Tables are still broken in 0.0.11 (needs to be renamed to lowercase, I added a note in the wiki)

For many users without cron job knowledge, using third party cron job service is a good choice.
There is another easy-to-use cron job service that may help: https://www.easycron.com.

source: gharchive/issue

authors: Sakarias-Longhorn Zumochi exodus4d kimian

license: mit

license_type: permissive

license_source: bigquery


text:
training own data

I am trying to train own data, i.e. scene text(road sign) detection.
Q1) I have 600 annotated data, but when I train with batch size = 16, there are ONLY 3~4 STEPS per a epoch.
see below report.
what's wrong with this? I expected 600/16 = 35 steps per a epoch.
Q2)  I wonder why it does not work well when I don't use pre-trained weights.
it just become explosion or meaningless oscillating.
Thank you very much in advance! :)
Epoch 1/50
1/3 [======>.......................] - ETA: 78s - loss: 52996.2266
2/3 [==============>...............] - ETA: 46s - loss: 26586.9480
3/3 [======================>.......] - ETA: 20s - loss: 17939.5313Epoch 00000: val_loss improved from inf to 69.81903, saving model to best_weights.h5

4/3 [===============================] - 383s - loss: 13474.0479 - val_loss: 69.8190
Epoch 2/50
1/3 [======>.......................] - ETA: 64s - loss: 110.6660
2/3 [==============>...............] - ETA: 41s - loss: 110.1645
3/3 [======================>.......] - ETA: 18s - loss: 120.9267Epoch 00001: val_loss did not improve

4/3 [===============================] - 390s - loss: 134.6366 - val_loss: 176.3403
Epoch 3/50
1/3 [======>.......................] - ETA: 70s - loss: 140.6994
2/3 [==============>...............] - ETA: 44s - loss: 131.1704
3/3 [======================>.......] - ETA: 19s - loss: 135.7138Epoch 00002: val_loss did not improve

4/3 [===============================] - 385s - loss: 155.2880 - val_loss: 157.5658
Epoch 4/50
1/3 [======>.......................] - ETA: 65s - loss: 79.9112
2/3 [==============>...............] - ETA: 42s - loss: 43.6893
3/3 [======================>.......] - ETA: 18s - loss: 31.8849Epoch 00003: val_loss improved from 69.81903 to 21.53916, saving model to best_weights.h5

4/3 [===============================] - 383s - loss: 33.7253 - val_loss: 21.5392
Epoch 5/50
1/3 [======>.......................] - ETA: 65s - loss: 15.6504
2/3 [==============>...............] - ETA: 41s - loss: 11.6136
3/3 [======================>.......] - ETA: 18s - loss: 9.0862

Oops! The small size of the training set was due to the fact that I messed up the training set and the validation set in the previous release. It's fixed now in the latest version.
I guessed that it's very hard to learn from scratch using just 600 images. Your network contains many millions of parameters. These parameters must be pre-trained on some big number of images to learn general features of visual objects. Re-training on pre-trained parameters means learning new combinations of learned features to detect new objects.
PS: there's actually a meme about it, https://www.facebook.com/photo.php?fbid=1578743938842788&set=gm.1640513226012467&type=3&theater&ifg=1

Aha! Thanks for your quick fix! :)
I will try again.
I have two small questions.

in other usual implementations of yolo2, I could see the parameter, "Subdivision" which determine the number of images to process in one time. is there also in yours?

is there any reference to understand the parameters(role or effect of each) below in detail?

thank you very much again for your sharing-
        "train_times":          10,
        "pretrained_weights":   "",
        "batch_size":           16,
        "learning_rate":        1e-4,
        "nb_epoch":             50,
        "warmup_batches":       100,

        "object_scale":         5.0 ,
        "no_object_scale":      1.0,
        "coord_scale":          1.0,
        "class_scale":          1.0

It works! thanks-
but there was a  'debug' variable problem. ("can not find argument 'debug'")
I just deleted the new 'debug' variable. is it okay?
I think that the problem comes from config(json doesn't have debug parameter) file. I don't know why exactly.
now it is training as below. looks fine, but what does it mean by "DEBUG" notification?
poch 1/50
2017-10-07 11:37:39.229935: I tensorflow/core/kernels/logging_ops.cc:79] DEBUG[0.0023333447][1.0431395][0.12933666][1.1362211][2.3110304][0.19540229][0.19540229]
  1/301 [..............................] - ETA: 8704s - loss: 2.31102017-10-07 11:38:02.560623: I tensorflow/core/kernels/logging_ops.cc:79] DEBUG[0.0020245272][0.82074636][0.12540188][1.079408][2.0275807][0.275][0.23520115]

  2/301 [..............................] - ETA: 7925s - loss: 2.16932017-10-07 11:38:26.660540: I tensorflow/core/kernels/logging_ops.cc:79] DEBUG[0.0015974327][

For subdivision, you mean a batch?
I have added the meaning of those parameters in the config.json file to the readme.
Missing 'debug' parameter is a bug. I fixed it. It's just a flag to turn on/off current losses and recall.
The formular is: 600*0.8 (80% for training, the rest 20% for validation)/16 (batch size) * 10 (train times, the number of times to cycle through the training set, useful for small datasets) = 300.

Thanks a lot!!
forget subdivision :)
my training images and Annotations are not size of 448 or 416.(640 480 instead)
is it okay? especially i worry about coordinates of annotations.
and don't I need to update Anchors to detect some like characters?
finally how long does it take to train one class in full yolo?
in my case it takes 1000sec per a epoch with 1080ti.
thanks to your kind project.

All sizes will be resized to the standard size of (416,416). As a result, the original bounding box positions need to be fixed. This is achieved by the "# fix object's position and size" section.
In most cases, I find the default anchors are fined. But in cases, when the sizes of the objects are much smaller than the size of the image, the sizes of the anchors should be scaled down, and vice versa for the other case.
All things equal, training time only really depends on the dataset. E.g., for coco dataset (83K images), it takes me 3 hours for each epoch.

3hours for a epoch! I see-
Thanks for all your advices. :)

Hi ,
I am trying to re-run the algorithm over the same images that i has been trained. but receiving error , tried to debug but unable to pin-point the main cause of error, Is it because of old version of Keras ?
below are the details
python predict.py -c config.json -w full_yolo_features.h5 -i racoon-001.jpg
Using TensorFlow backend.
Traceback (most recent call last):
File "predict.py", line 72, in
main(args)
File "predict.py", line 50, in main
anchors=config['model']['anchors'])
File "/media/zfar/media files/CarProject/githubYoloClone/basic-yolo-keras/models.py", line 171, in init
x = Conv2D(self.nb_box * (4 + 1 + self.nb_class), (1,1), strides=(1,1), padding='same', name='conv_23', kernel_initializer='lecun_normal')(x)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 88, in wrapper
return func(*args, **kwargs)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/layers/convolutional.py", line 455, in init
**kwargs)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/layers/convolutional.py", line 110, in init
self.kernel_initializer = initializers.get(kernel_initializer)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/initializers.py", line 463, in get
return deserialize(config)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/initializers.py", line 455, in deserialize
printable_module_name='initializer')
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 133, in deserialize_keras_object
': ' + class_name)
ValueError: Unknown initializer: lecun_normal

I faced the same error and I just changed it to 'he_normal'. Because it
seemed like just a initialization.

오전 6:39에 "zfar Mahmood" notifications@github.com님이 작성:

Hi ,
I am trying to re-run the algorithm over the same images that i has been
trained. but receiving error , tried to debug but unable to pin-point the
main cause of error, Is it because of old version of Keras ?
below are the details
python predict.py -c config.json -w full_yolo_features.h5 -i racoon-001.jpg
Using TensorFlow backend.
Traceback (most recent call last):
File "predict.py", line 72, in
main(args)
File "predict.py", line 50, in main
anchors=config['model']['anchors'])
File "/media/zfar/media files/CarProject/githubYoloClone/basic-yolo-keras/models.py",
line 171, in init
x = Conv2D(self.nb_box * (4 + 1 + self.nb_class), (1,1), strides=(1,1),
padding='same', name='conv_23', kernel_initializer='lecun_normal')(x)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/legacy/interfaces.py",
line 88, in wrapper
return func(*args, **kwargs)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/layers/convolutional.py",
line 455, in init
**kwargs)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/layers/convolutional.py",
line 110, in init
self.kernel_initializer = initializers.get(kernel_initializer)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/initializers.py",
line 463, in get
return deserialize(config)
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/initializers.py",
line 455, in deserialize
printable_module_name='initializer')
File "/home/zfar/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py",
line 133, in deserialize_keras_object
': ' + class_name)
ValueError: Unknown initializer: lecun_normal
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/experiencor/basic-yolo-keras/issues/17#issuecomment-337380208,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYAAVn42rnwiSFBixR9mQZ5eQXmStMF5ks5stR57gaJpZM4PwYji
.

@zfar- all the ***_features.h5 file contains the pre-trained weight parameters of all the layers except the last layers. That's why you see 1 layer missing when you try to load the files. These files will be automatically loaded by the model to all layers except the last one before training.
I do it this weight because the size of the last layer depends on the number of classes you want to train. However, it creates a lot of confusion. I will edit the readme to include this piece of information.

@experiencor Thanks a lot , it would really clear many things not just for me but also for other who would have liked you work.
Indeed i was getting close but I was unable to understand where to edit the layer to get it working

authors: Kevin-Moon experiencor zfar-

repo: experiencor/basic-yolo-keras

license: MIT

license_source: github-api


text:
App crashes on splash screen

Thanks for the great work for Expo 50.
I enabled the DevTools plugin for react-navigation in my index.tsx file:

The app works fine with the dev server locally. But When I build it and try the development build (apk file on my device or emulator), the app hangs at the Splash screen. And this is the adb log from the console:
01-20 14:00:03.693  4767  4812 I cr_LibraryLoader: Successfully loaded native library
01-20 14:00:03.693  4767  4812 I cr_CachingUmaRecorder: Flushed 8 samples from 8 histograms.
01-20 14:00:03.699  4767  4811 E ReactNativeJS: Error: Failed to setup client from useDevToolsPluginClient: [object Object]
01-20 14:00:03.699  4767  4811 E ReactNativeJS:
01-20 14:00:03.699  4767  4811 E ReactNativeJS: This error is located at:
01-20 14:00:03.699  4767  4811 E ReactNativeJS:     in Index
01-20 14:00:03.699  4767  4811 E ReactNativeJS:     in RCTView
01-20 14:00:03.699  4767  4811 E ReactNativeJS:     in Unknown
01-20 14:00:03.699  4767  4811 E ReactNativeJS:     in RCTView
01-20 14:00:03.699  4767  4811 E ReactNativeJS:     in Unknown
01-20 14:00:03.699  4767  4811 E ReactNativeJS:     in AppContainer, js engine: hermes
01-20 14:00:03.701   402   402 I RanchuHwc: validateDisplay: layer 66 CompositionType 1, fallback to client
01-20 14:00:03.701   402   402 I RanchuHwc: validateDisplay: layer 65 CompositionType 1, fallback to client
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: Error: Failed to setup client from useDevToolsPluginClient: [object Object]
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: This error is located at:
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:     in Index
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:     in RCTView
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:     in Unknown
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:     in RCTView
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:     in Unknown
01-20 14:00:03.702  4767  4812 E unknown:ReactNative:     in AppContainer, js engine: hermes, stack:
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: ?anon_0_@1:3334106
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: asyncGeneratorStep@1:148149
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: _throw@1:148451
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: tryCallOne@53:15
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: anonymous@139:26
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: anonymous@1:321582
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: _callTimer@1:320581
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: _callReactNativeMicrotasksPass@1:320725
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: callReactNativeMicrotasks@1:322659
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: __callReactNativeMicrotasks@1:163417
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: anonymous@1:162552
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: __guard@1:163291
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: flushedQueue@1:162463
01-20 14:00:03.702  4767  4812 E unknown:ReactNative: callFunctionReturnFlushedQueue@1:162319

Versions
expo: 50.0.2
react-navigation/native: 6.1.9
react-navigation/stack: 6.3.20
react-navigation/drawer: 6.6.6
Not sure if this is related to this plugin or react-router. Thanks.

sorry i was not doing good for the error message, could you help to troubleshoot at your node_modules/expo/build/devtools/index.js to dump the error and its stack
        async function setup() {
            try {
                const client = await getDevToolsPluginClientAsync(pluginName);
                setClient(client);
            }
            catch (e) {
                setError(new Error('Failed to setup client from useDevToolsPluginClient: ' + e.toString()));
            }
        }

in the catch section, trying to console.log(e.stack) or console.log(e)

Will do it when I get home @Kudo,
In addition to that, Should we replace the e.toString() with JSON.stringify(e) ? I can create a PR for that. toString fails when the error is an object. JSON.stringify can parse and stringify strings, numbers, objects, and arrays.

thanks. welcome for the contribution. let's see what's the error first.
my thought was only to decorate the error. maybe we could do something like that:
      try {
        const client = await getDevToolsPluginClientAsync(pluginName);
        setClient(client);
      } catch (e) {
        e.message = 'Failed to setup client from useDevToolsPluginClient: ' + e.message;
        setError(e);
      }

Will do it when I get home @Kudo,
In addition to that, Should we replace the e.toString() with JSON.stringify(e) ? I can create a PR for that. toString fails when the error is an object. JSON.stringify can parse and stringify strings, numbers, objects, and arrays.

My goto for errors is usually:
let errorString;
try {
  errorString = JSON.stringify(error);
} catch {
  errorString = String(error);
}

as JSON.stringify can throw depending on the object it gets, calling `String()` has the same functionality as `.toString()` but handles any value.

the downside of new Error(...) is that we will miss the original stack trace. since we will rethrow the exception later, it would be good if we can find a way to keep the original stack.

Well, there is Error.prototype.cause but IDK how much support there is for that

that's why i'd tried for e.message = 'Failed to setup client from useDevToolsPluginClient: ' + e.message; and not to re-create a new Error instance.

I am back.
But I couldn't get the error message content. Editing the file under node_modules is not working because both expo run and eas build and even eas build --local are not using my modified node_modules folder. They all run npm install  internally.
And this error doesn't exist in the local development environment (npx expo start). So I think 2 options here:
1 - I will fork this repository, edit that file, and add my fork as a dependency instead of this one.
2 - We will replace that toString() part with String(e) and release a new version of devtools plugin (if possible)
What do you suggest ?

Will do it when I get home @Kudo,
In addition to that, Should we replace the e.toString() with JSON.stringify(e) ? I can create a PR for that. toString fails when the error is an object. JSON.stringify can parse and stringify strings, numbers, objects, and arrays.

My goto for errors is usually:
String(error)

as JSON.stringify can throw depending on the object it gets, calling String() has the same functionality as .toString() or Error.prototype.message but handles any value safely.

I didn't know that JSON.stringify could throw depending on the object. And looks like you are right. This is from MDN:

Thrown in one of the following cases:

value contains a circular reference.
A BigInt value is encountered.

But String() does not throw for any value. Thanks for the tip @jthoward64

But I couldn't get the error message content. Editing the file under node_modules is not working because both expo run and eas build and even eas build --local are not using my modified node_modules folder. They all run npm install internally.

good to know it's using eas build. in this case you may need to modify and use patch-package to generate the patch and on postinstall to apply the patch.

I think this is the error message:
{ isTrusted: false, message: [Getter/Setter] }
But I am not sure 100%. Does this make any sense in this context ? If not I can keep digging. @Kudo

looks strange to me, having no idea how it comes from. could you try to dump to stack trace?

Sorry for the limited feedback. It is hard to work with update -> patch -> build -> install to emulator -> adb logs flow :) I will update here If I find more.

no worries! after you generate builds from eas build, you may try to modify node_modules/expo locally before running npx expo start, then you don't need to re-resubmit eas build again.

OK. I was not able to reproduce this on compiled apps. Once a new version is released that fixes that error logging, I will try that again.
I will create a separate issue for that. (or maybe a PR ?)
Btw, if the error is something like { isTrusted: false, message: [Getter/Setter] }, then using String(e) also returns [object Object]. The only method that outputs a proper stringified version was JSON.stringify(e) for me.  @Kudo @jthoward64

The only method that outputs a proper stringified version was JSON.stringify(e) for me.  @Kudo @jthoward64

You just have to be careful using JSON.stringify because if it throws you will mask the initial error completely. What I usually do (more complex) is use a try catch to prefer JSON.stringify and fallback to String

Yes, that's also what I thought. try/catch for JSON stringify and String makes sense. That's also what I used for encoding/decoding scalars for GraphQL.

Im have the same error but only in my production build, when i build the same commit to development it runs ok

I also don't get this in development, but release builds hang after the splash screen hides -- looks to be during the initial render. I was able to log the error with JSON.stringify(e), but the stack trace isn't super helpful.
`Error: Failed to setup client from useDevToolsPluginClient: {"isTrusted":false,"message":"The operation couldn’t be completed. Connection refused"}
This error is located at:
in AppNavigator
in RCTView
in Unknown
in TouchListener
in RNCSafeAreaProvider
in SafeAreaProvider
in App
in ReactNativeProfiler
in RCTView
in Unknown
in __Sentry.TouchEventBoundary
in RootApp
in RCTView
in Unknown
in RCTView
in Unknown
in AppContainer, js engine: hermes`

I'm using this patch as a workaround. I'm not sure that throwing from the hook is the best way to handle errors in the case. Obviously, we should understand what is the root cause of the error and fix that, but I'm thinking there also might be a better way to handle the errors, since this implementation breaks the app entirely.
diff --git a/node_modules/expo/build/devtools/index.js b/node_modules/expo/build/devtools/index.js
index 25c7e7c..560fdfd 100644
--- a/node_modules/expo/build/devtools/index.js
+++ b/node_modules/expo/build/devtools/index.js
@@ -33,7 +33,8 @@ export function useDevToolsPluginClient(pluginName) {
         };
     }, [pluginName]);
     if (error != null) {
-        throw error;
+        // throw error;
+        console.log(`An error was caught in useDevToolsPluginClient: ${JSON.stringify(error)}`);
     }
     return client;
 }

Also seeing a similar issue using drizzle dev tools: https://github.com/drizzle-team/drizzle-studio-expo/issues/1

@osamaqarem thanks for saving my day 👍

similar issue using drizzle dev tools

@osamaqarem thanks a lot I had this issue for week now it gone after remove useDrizzleStudio()

Also seeing a similar issue using drizzle dev tools: drizzle-team/drizzle-studio-expo#1

Thank you 😭

I had similar issue and I solved using variable to use drizzle studio only at development env.
 if (!process.env.EXPO_PUBLIC_DISABLE_FEATURE) {
        useDrizzleStudio(expoDb)
    }

Using the __DEV__ flag to handle it is a nice way to circumvent this:
if (__DEV__) {
  useDrizzleStudio(expoDb);
}

authors: DarlonHenrique Kudo abdibaker alioguzhan bpeltonc jthoward64 kimuradev likaci osamaqarem tasmto victorlap

repo: expo/dev-plugins


text:
content type always undefined

var type = res.getHeader('Content-Type')

always yield undefined with express >= 4.10.0

Express changes

It works just fine. Everything there is a content type issue it's because the install is corrupted on your disk. Please follow the instructions at https://github.com/expressjs/compression/issues/35#issuecomment-77078554 and let me know how it goes.

@dougwilson nope, already did it, did not worked, I downgraded express to see where it fails and it fails exactly at 4.10.0

Ok. I mean, I and thousands of others use it just fine and this middleware doesn't use anything from express. Can you post an example app that doesn't work with the request to make?

'use strict';

var http = require('http');
var express = require('express');
var path = require('path');
var compression = require('compression');

var app = express();

app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// app.use(compression());

app.use('/', (function () {
  // I added this IIFE on purpose to demonstrate you without any JS require
  var express = require('express');
  var router = express.Router();

  /* GET home page. */
  router.get('/', function (req, res, next) {
    res.render('index', {});
  });

  return router;
})());

http.createServer(app).listen(8080);

└── express@4.12.3
└── compression@1.4.3

Request header:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
....

Response header:
Connection:keep-alive
Content-Length:36
Content-Type:text/html; charset=utf-8
Date:Sat, 18 Apr 2015 15:22:04 GMT
ETag:W/"24-ae57b51"
Vary:Accept-Encoding
X-Powered-By:Express

I just pushed up the branch test-expres-4.12 to this repo which changes every test to use Express 4.12.2 instead of just the plain Node.js HTTP server. Every tests passes with Express 4.12.2: https://travis-ci.org/expressjs/compression/builds/59037148
Feel free to pull down that branch and run it on your machine. If that same branch fails there, you have a corrupted install. If it passes, then it may be some kind of conflict in your existing server code that was brought out with Express.

@FGRibreau your example it's useful since I cannot run it without the views. Can you simplify it more? Also, I know we posted at the same time, but please also run that scenario above to see what you get.

views/index.jade:
html
  body
    p test

I'm sorry I don't have the time to go further (for now)

@FGRibreau that view's response is not compressed because it's under 1KB in size (see the https://github.com/expressjs/compression#threshold option in the readme). By default we don't compress anything below 1KB, since doing so is useless and sometimes even makes the file bigger instead of smaller.
If you really want that view to be compresses, you can change the threshold option.

Indeed, I already changed threshold to 0 but at that time it did not worked on my original code, I removed a lot of express middleware since and now it works, thanks

Ah, I see. It's possible there is a conflict somewhere. Every if it's not a middleware I own, if you find which one is conflicting, please let me know, because I'd like to take a look into it to see if it's something I need to change or the other middleware does.

Hey guys! I'm using express@4.13.3 and compressions is still not working. Is there a way to somehow debug compression middleware?

authors: FGRibreau dougwilson otobrglez

repo: expressjs/compression


text:
Change res.flush to accept a callback function argument

Discussions around this can be found at https://github.com/expressjs/compression/issues/56

It works on all supported Node.js versions, so seems fine to me :+1:

Hey Doug, is there any timeline or module release date when this will be included?

Hi @bijoythomas, this PR has conflicts, please resolve them.

source: gharchive/pull-request

authors: bijoythomas bjohansebas dougwilson


text:
NodeError: Cannot call write after a stream was destroyed in VSCode Debug

I am using VSCode's launch.json with debug mode and debug console along with nodemon to restart the server after file changes. The app is a simple express application for a REST API. I am using morgan just as is for logging HTTP request/response.
To make my life easier, I've added the following to my launch.json to start the app and reconnect the debugger automatically since nodemon will kill the server on file changes. On the very first run of my application via VSCode, things work just fine. I get logs on debug console as expected and no problems. However, as soon as I change a file and nodemon kicks in and VSCode debugger disconnects and connects again, when I hit the API, I get the following:
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:411:19)
    at writeOrBuffer (_stream_writable.js:399:5)
    at Socket.Writable.write (_stream_writable.js:299:11)
    at logRequest (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/morgan/index.js:130:14)
    at logger (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/morgan/index.js:135:7)
    at Layer.handle [as handle_request] (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:317:13)
    at /Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:317:13)
    at /Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:275:10)
    at query (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/middleware/query.js:45:5)
    at Layer.handle [as handle_request] (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:317:13)
    at /Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/router/index.js:174:3)
    at Function.handle (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/application.js:174:10)
    at Server.app (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/express/lib/express.js:39:9)
    at Server.emit (events.js:198:13)
    at parserOnIncoming (_http_server.js:677:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)

Or sometimes, it is this one which causes the server to crash:
NodeError: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:411:19)
    at writeOrBuffer (_stream_writable.js:399:5)
    at Socket.Writable.write (_stream_writable.js:299:11)
    at Array.logRequest (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/morgan/index.js:130:14)
    at listener (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/on-finished/index.js:169:15)
    at onFinish (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/on-finished/index.js:100:5)
    at callback (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/ee-first/index.js:55:10)
    at ServerResponse.onevent (/Users/ssudheer/Develop/greenqloud/fabric-cvs-provisioning-service/node_modules/ee-first/index.js:93:5)
    at ServerResponse.emit (events.js:203:15)
    at onFinish (_http_outgoing.js:671:10)
    at process._tickCallback (internal/process/next_tick.js:61:11)
Emitted 'error' event at:
    at errorOrDestroy (internal/streams/destroy.js:107:12)
    at onwriteError (_stream_writable.js:430:5)
    at onwrite (_stream_writable.js:461:5)
    at doWrite (_stream_writable.js:411:11)
    at writeOrBuffer (_stream_writable.js:399:5)
    [... lines matching original stack trace ...]
    at process._tickCallback (internal/process/next_tick.js:61:11)

I thought this was a bug with morgan initially, updated it to the latest stable release and tried again but I kept getting these errors. On further research, I noticed that this only happens within VSCode's debugger context and not when I am directly running it in the CLI. That too, only after a debugger reconnect and not on the very first app start. Can someone shine a light on if this is a VSCode specific issue that's causing this to morgan (I didn't experience this with anything else) or am I doing something wrong?

Okay, so I discovered a setting for launch configuration items, "console": "integratedTerminal" which switched the output to the integrated terminal. With this setting, I'm not seeing any issues which means this could very well be associated with VSCode and not morgan. If someone thinks so too, Imma move this to microsoft/code.

I had same issue as yours. Able to resolve by updating launch.json. In your launch.json check runtime version is same as your global node version.

So based on the stack trace, it looks as if process.stdout stream was destroyed at some point. This module could be updated such that it doesn't try to write to a destroyed stream, which would mean you don't get the error any longer, but it seems like it would likely just result is no further morgan output once that happens. I'll have to install and play around with VSCode to see what is going on unless someone knows of a solution.

@sangeeth96 there's also a setting called outputCapture which can be set to std which will capture logs that write to stdout like morgan does by default.  The issue you were experiencing was definitely with vscode and is resolved via settings available in vscode.
I'm going to go ahead and close this issue but don't hesitate to open a new one if logs aren't writing as expected in the future!

Hi, I am having the same issue that started to appear within a verdaccio docker  container and I do not understand it, do you guys have any hint? This became critical since it break all our CIs

hi @kopax do you mind opening a new issue with more specifics around what you're doing with verdaccio? This issue was created for vscode specifically so it'd be great to get a new issue specific for the issue you're having with verdaccio. Please add a minimal reproducible example as well. Thanks!

it seems to be indeed a problem with visual studio code. By adding the property "console" (see below) the problem disappears.
{
            "name": "Nodemon",
            "type": "node",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "runtimeExecutable": "nodemon",
            "runtimeArgs": [
                "--inspect-brk"
            ],
            "program": "${workspaceFolder}/bin/www",
            "restart": true,
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen"
        }

For me it happened because i switched the VSCode default terminal from WSL to powershell. Returning it to the previous one, it worked.

For me it happened because i switched the VSCode default terminal from WSL to powershell. Returning it to the previous one, it worked.

authors: bersuc dougwilson kopax ryhinchey sangeeth96 sappusaketh tgirotto

repo: expressjs/morgan


text:
xtask: Minor documentation addition

A typical workflow for making a PR to extendr may involve
cargo extendr document
cargo extendr devtools-test
cargo extendr devtools-test -a

(and maybe even cargo extendr r-cmd-check)
However, when looking at the overview presented to you by
cargo extendr, you won't see "snapshots" anywhere.
Unless of course, you wrote cargo extendr devtools-test -h,
where you'd see --accept-snapshot.
But what generates them? Well cargo extendr devtools-test-invocation does!

Thank youuuuuuuuuuuu!

authors: CGMossa JosiahParry

repo: extendr/extendr


text:
Exception while flushing the report in MAC

Hi,
I am getting following error while trying to flush the report in MAC:
Error Message: Errors while compiling a Template.
Please try the following to solve the situation:
* If the problem is about missing/invalid references or multiple defines either try to load
the missing references manually (in the compiling appdomain!) or
Specify your references manually by providing your own IReferenceResolver implementation.
See https://antaris.github.io/RazorEngine/ReferenceResolver.html for details.
Currently all references have to be available as files!
* If you get 'class' does not contain a definition for 'member':
try another modelType (for example 'null' to make the model dynamic).
NOTE: You CANNOT use typeof(dynamic) to make the model dynamic!
Or try to use static instead of anonymous/dynamic types.
More details about the error:
- warning: (9, 4) Unnecessary using directive.
- warning: (7, 4) Unnecessary using directive.
- warning: (8, 4) Unnecessary using directive.
- warning: (6, 4) Unnecessary using directive.
- warning: (12, 4) Unnecessary using directive.
- warning: (5, 4) Unnecessary using directive.
- warning: (11, 4) Unnecessary using directive.
- warning: (10, 4) Unnecessary using directive.
- error: (0, 0) Unexpected error writing debug information -- 'COM Interop is not supported on this platform.'
Thanks
Preeti

@preetipadalia Please share the version of ExtentReports.  Is it https://www.nuget.org/packages/ExtentReports/4.1.0-beta1?

@anshooarora  Yes its 4.1.0-Beta1.  I just identified the issue in RazorEngine.NetCore.

I tried running on MacOS Catalina without issues. I will look into this
Are you using. NET Core 2.1, or 3.1?

I am using .netcoreapp3.1.

authors: anshooarora preetipadalia

repo: extent-framework/extentreports-csharp


text:
Creating two ClusterSecretStore pointing to different regions in the same cluster

Is there a possibility for creating two ClusterSecretStore in the same cluster where each refers to a different region of the same account? Both ClusterSecretStores will be referred to pull values for a single ExternalSecret. This will be helpful in case of a disaster. When failed over, the AWS Secrets Manager or Azure Key vaults go into read-only mode. But if we have to change the values, it would be helpful if we could refer to a region where the write permissions are also enabled.

Hey, yeah there is a region field in the provider spec, that should do it.
There is a example yaml spec at the top of the page here: https://external-secrets.io/v0.7.0/provider/aws-secrets-manager/

Thanks for the quick reply!
This is how it is present in the cluster with a single ClusterSecretStore
spec:     secretStoreRef:         name: secretstore-aws         kind: ClusterSecretStore     data:     - secretKey: <key 1>       remoteRef:           key: <secret name 1>           property: <key 1>     - secretKey: <key 2 >        remoteRef:           key: <secret name 2>           property: <key 2>
I'm referring to two different secrets present in the same region. Say, I need the secret name 2 from a different region, how should the ExternalSecret definition be changed to refer to the secondary region?

The straight-forward solution would be to have the secrets with the same name in both regions:

eu-central-1
eu-west-1

secret1
secret1

secret2
secret2

With that you just need to swap out the cluster-secret-store reference:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: "database-credentials"
spec:
  secretStoreRef:
    name: aws-sm-eu-central-1 # swap this out with a css pointing to the different region
    kind: ClusterSecretStore

Hope that makes sense.

Yes that makes sense. Another question is, if I'm using service accounts to authenticate to the SecretsManager, in this case I will require two service accounts, one pointing to us-east-1 and another to us-west-2.  The current helm chart provides the functionality to create one Service Account. Any more ServiceAccount that I need to create will require changes in the RoleBindings, ClusterRoleBindings and Deployments to include that additional ServiceAccount right? Will it require any change in the CRDs?

There is no need to use the external-secrets service-account provided by the helm chart. It's best to use dedicated service accounts which are used for authenticating with AWS.

So we can create multiple service accounts in an environment and they need not be mounted to the deployment to be able to pull the secrets from SecretsManager?

No, they don't need to be mounted. In your Clsuter Secret Store, you can specify a serviceAccountRef which will be used dynamically by ESO.

Oh alright...I was able to create it. Thanks for the help

glad it worked :+1:, closing this issue then. Feel free to comment if any other questions arise.

authors: gusfcarvalho moolen rajharini

repo: external-secrets/external-secrets


text:
Improves kubernetes provider examples documentation

Solves #850

@ADustyOldMuffin Do you mind checking if the new redact helped with k8s provider understanding?

Looks excellent!

/approve

/merge

thanks @rodrmartinez for the update :rocket:


text:
Secret changes due to polling triggering rolling deploy

Some of the backends that you provide interaction with include polling. With polling, a changed secret (possibly due to password rotation) could be reflected in an updated Secret.
I can't find any documentation in your repo about providing a means of having Secret updates trigger a rolling deploy for those components that refer to the given Secrets. I wasn't sure if you all had a best practice, or if you'd recommend using something like https://github.com/wave-k8s/wave.
Any recommendations would be great. Thanks!

Looking at https://github.com/stakater/Reloader or https://github.com/wave-k8s/wave would indeed be the way to go :)

@Flydiverny - thanks so much!


text:
安装完成无法正常使用

docker方式部署，建立完管理员帐号提示“没有找到能够处理 /api/install/finish的方法”

Error 1366: Incorrect string value: '\xE8\x93\x9D\xE7\x9C\xBC...' for column 'name' at row 1

Error 1366: Incorrect string value: '\xE8\x93\x9D\xE7\x9C\xBC...' for column 'name' at row 1

这个一般是你的数据库没有指定为utf-8格式导致的。

3.0.0.Beta2 重构了安装程序，添加钉钉群体验

repo: eyebluecn/tank


text:
Symfony Class Loader and swiftmailer broken dependencies

I required the Silex package using composer and wound up with a few dependency errors. First, I was missing the Symfony Universal Class Loader, so I manually included that in my composer.json require list. I noticed that it's not in Silex's require list - should it be? Or is this an indication of a larger issue?
The second issue is a broken path to the swiftmailer package:
Fatal error: require_once() [function.require]: Failed opening required '/home/dan/workspace/my-project/vendor/swiftmailer/lib/classes/Swift.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/dan/workspace/my-project/vendor/silex/silex/src/Silex/Provider/SwiftmailerServiceProvider.php on line 76

I have swiftmailer required as well in my composer.json, but I took a look at its install path and it's a little different than what Silex seems to expect:
...
vendor
  `- silex/
   - swiftmailer
    `- swiftmailer
      `- doc/
       - lib
        `- classes
          `- Swift/
           - Swift.php
       ...
    ...
  ...

So it looks like swiftmailer is installing to /vendor/swiftmailer/swiftmailer, rather than just /vendor/swiftmailer. Is this a bug on swiftmailer's end? Also, it looks like swiftmailer is not in the require property of Silex's composer.json.
Heres my relevant require block in my composer.json:
"require": {
    "silex/silex": "1.0.0-dev",
    "symfony/class-loader": ">=2.0.7",
    "predis/service-provider": "v0.2.3",
    "swiftmailer/swiftmailer": ">=4.1.4"
}

I'm also using composer's automatically generated autoload functionality, could that be the issue?

Swiftmailer is not required by Silex itself. And when using composer, it is totally normal to have it installed in vendor/swiftmailer/swiftmailer as it is the way Composer works.

The reason I did not include the ClassLoader component in composer.json is that once we establish composer as the standard distribution channel, we no longer need the $app['autoloader'] service, as composer ships with an autoloader already.
You really should not need it.
And the other problem that @stof already mentioned is that you are pointing the swiftmailer.class_path to vendor/swiftmailer, where it should be vendor/swiftmailer/swiftmailer. The reason why this is needed lies in the way swiftmailer does its bootstrapping. It has a Swift.php file that needs to be included in addition to the custom autoloader that the library ships with. It's kind of unfortunate that it's not fully PEAR/PSR-0 compliant, but that's the way it is.

Ah, thanks for the clarification on Swiftmailer. I should have noticed that one on my own!
Regarding the ClassLoader: Until Silex is modified to use Composer's autoload functionality out of the box, should I just manually require ClassLoader in my project's root composer.json? Without it, Silex's Application constructor produces a 'class not found' fatal error, as it still uses it in instantiating its own autoloader (Line 62).

@danapplegate yep you should.
Actually, until Silex is modified, it should even require it itself

The application constructor has a definition for the autoloader service, but if you never use it, that code is never executed. Just don't supply any class_path options anywhere (except for swiftmailer, since it uses its own autoloader). Then you should be able to use it just fine. ;-)

Ah yes, I had just realized that and was writing a comment correcting myself. You guys are too quick!
I wish I could use Composer's autoloading alone -- I love being able to just write a line in my require block, run php composer.phar update, and being able to use the new packages immediately, without any configuration. Unfortunately, my problem is that not all the third-party libraries I'm using are properly namespaced, making them a real pain to integrate into Composer's autoloading framework. Until I can either fork my own compliant versions of those libraries, or come up with some other solution, I'll have to use both autoloaders.
Thanks for your awesome work, guys! Keep it up!

authors: danapplegate igorw stof

repo: fabpot/Silex


text:
Fabric Release Automation

Set up automated releases using semantic release and github actions as per  https://gist.github.com/benja/211fbddf3883ffed95a55edcfd1e7e9f and https://github.com/fabric-ds/issues/blob/master/rfcs/0004-releases.md.
Also moved over to NPM to slowly move over to using the same package manager for all repos.

Also, did you manage to get commit messages checked/validated/linted as part of build or commit?

I've not done this yet, no. Will look into this asap.

repo: fabric-ds/vue


text:
Too many escapes in GET /slivers output

I tried a GET /slivers?slice_id=018eb740-6452-4876-b229-2895512e0ace.  In the result, the data[0].sliver part looks odd:
{
    "data": [
        {
            "graph_node_id": "8b868321-2722-447e-aff8-6c84df0d1aca",
            "join_state": "NoJoin",
            "lease_end_time": "2022-09-01 11:05:16 +0000",
            "lease_start_time": "2022-08-31 11:05:18 +0000",
            "notice": "Reservation b2257771-6765-488e-97d9-9cdcc4279ae9 (Slice MySlice(018eb740-6452-4876-b229-2895512e0ace) Graph Id:03e845d6-0f20-4745-b2f3-31c195a8c287 Owner:owner@example.net) is in state (Closed,None_) ",
            "pending_state": "None_",
            "slice_id": "018eb740-6452-4876-b229-2895512e0ace",
            "sliver": "{\"Name\": \"Node1\", \"Type\": \"VM\", \"Capacities\": \"{\\\"core\\\": 2, \\\"disk\\\": 10, \\\"ram\\\": 8}\", \"CapacityHints\": \"{\\\"instance_type\\\": \\\"fabric.c2.m8.d10\\\"}\", \"CapacityAllocations\": \"{\\\"core\\\": 2, \\\"disk\\\": 10, \\\"ram\\\": 8}\", \"LabelAllocations\": \"{\\\"instance_parent\\\": \\\"dall-w1.fabric-testbed.net\\\"}\", \"ReservationInfo\": \"{\\\"error_message\\\": \\\"\\\", \\\"reservation_id\\\": \\\"b2257771-6765-488e-97d9-9cdcc4279ae9\\\", \\\"reservation_state\\\": \\\"Active\\\"}\", \"NodeMap\": \"[\\\"508c3fa3-df17-41ab-bb95-fdf71c105a61\\\", \\\"GDXZNF3\\\"]\", \"StitchNode\": \"false\", \"ImageRef\": \"default_rocky_8,qcow2\", \"Site\": \"DALL\"}",
            "sliver_id": "b2257771-6765-488e-97d9-9cdcc4279ae9",
            "sliver_type": "NodeSliver",
            "state": "Closed"
        }
    ],
    "size": 1,
    "status": 200,
    "type": "slivers"
}

The escape sequences are because it's a JSON within a JSON (default json behavior)

If the response is meant to be nested JSON, perhaps it should be of the below form?
{
    "data": [{
        "graph_node_id": "8b868321-2722-447e-aff8-6c84df0d1aca",
        "join_state": "NoJoin",
        "lease_end_time": "2022-09-01 11:05:16 +0000",
        "lease_start_time": "2022-08-31 11:05:18 +0000",
        "notice": "Reservation b2257771-6765-488e-97d9-9cdcc4279ae9 (Slice MySlice(018eb740-6452-4876-b229-2895512e0ace) Graph Id:03e845d6-0f20-4745-b2f3-31c195a8c287 Owner:owner@example.net) is in state (Closed,None_) ",
        "pending_state": "None_",
        "slice_id": "018eb740-6452-4876-b229-2895512e0ace",
        "sliver": {
            "Name": "Node1",
            "Type": "VM",
            "Capacities": {
                "core": 2,
                "disk": 10,
                "ram": 8
            },
            "CapacityHints": {
                "instance_type": "fabric.c2.m8.d10"
            },
            "CapacityAllocations": {
                "core": 2,
                "disk": 10,
                "ram": 8
            },
            "LabelAllocations": {
                "instance_parent": "dall-w1.fabric-testbed.net"
            },
            "ReservationInfo": {
                "error_message": "",
                "reservation_id": "b2257771-6765-488e-97d9-9cdcc4279ae9",
                "reservation_state": "Active"
            },
            "NodeMap": [
                "508c3fa3-df17-41ab-bb95-fdf71c105a61",
                "GDXZNF3"
            ],
            "StitchNode": false,
            "ImageRef": "default_rocky_8,qcow2",
            "Site": "DALL"
        },
        "sliver_id": "b2257771-6765-488e-97d9-9cdcc4279ae9",
        "sliver_type": "NodeSliver",
        "state": "Closed"
    }],
    "size": 1,
    "status": 200,
    "type": "slivers"
}

With this form, we can easily access sub-fields when we handle the response with tools like jq or in client programs. With jq, with the form I am proposing here, we can access  jq '.data[0].sliver.Capacities.disk'; with the current response form, we can't do that without another decoding step.  Similarly, with python, we should be able to do something like json.loads(response.body)['data'][0]['sliver']['Capacities']['disk'].

While we're considering this, I guess the notice field also could be made easier to parse, with a form like:
{
  "notice": {
    "Reservation": "b2257771-6765-488e-97d9-9cdcc4279ae9",
    "Slice": {
      "name": "MySlice",
      "SliceId": "018eb740-6452-4876-b229-2895512e0ace"
    },
    "GraphId": "03e845d6-0f20-4745-b2f3-31c195a8c287",
    "Owner": "owner@example.net",
    "State": "(Closed,None_)"
  }
}

That could be a little better if State sub-field is made simpler.
This is not something that needs immediate attention though. I was looking into Orchestrator API (for Reasons™) and thought that it could be made a little bit nicer from a tool writer's perspective.  Since I haven't actually written any such tool yet, it is only an opinion that really should not carry much weight. :-)

repo: fabric-testbed/ControlFramework


text:
Error: No provider for Boolean!

I am seeing the following error when trying to run the frontend locally and navigating to http://localhost:8088/filtered-wizard/all/launchpad-new-project/1/e30%3D:
ERROR Error: No provider for Boolean!
    at injectionError (eval at <anonymous> (vendor.js:21), <anonymous>:1372:90)
    at noProviderError (eval at <anonymous> (vendor.js:21), <anonymous>:1410:12)
    at ReflectiveInjector_._throwOrNull (eval at <anonymous> (vendor.js:21), <anonymous>:2852:19)
    at ReflectiveInjector_._getByKeyDefault (eval at <anonymous> (vendor.js:21), <anonymous>:2891:25)
    at ReflectiveInjector_._getByKey (eval at <anonymous> (vendor.js:21), <anonymous>:2823:25)
    at ReflectiveInjector_.get (eval at <anonymous> (vendor.js:21), <anonymous>:2692:21)
    at resolveNgModuleDep (eval at <anonymous> (vendor.js:21), <anonymous>:9692:25)
    at NgModuleRef_.get (eval at <anonymous> (vendor.js:21), <anonymous>:10780:16)
    at resolveDep (eval at <anonymous> (vendor.js:21), <anonymous>:11283:45)
    at createClass (eval at <anonymous> (vendor.js:21), <anonymous>:11142:147)
    at createDirectiveInstance (eval at <anonymous> (vendor.js:21), <anonymous>:10967:37)
    at createViewNodes (eval at <anonymous> (vendor.js:21), <anonymous>:12415:49)
    at createEmbeddedView (eval at <anonymous> (vendor.js:21), <anonymous>:12298:5)
    at callWithDebugContext (eval at <anonymous> (vendor.js:21), <anonymous>:13696:42)
    at Object.debugCreateEmbeddedView [as createEmbeddedView] (eval at <anonymous> (vendor.js:21), <anonymous>:13042:12)
    at TemplateRef_.createEmbeddedView (eval at <anonymous> (vendor.js:21), <anonymous>:10482:38)
    at ViewContainerRef_.createEmbeddedView (eval at <anonymous> (vendor.js:21), <anonymous>:10259:52)
    at SwitchView.create (eval at <anonymous> (vendor.js:120), <anonymous>:2055:32)
    at SwitchView.enforceState (eval at <anonymous> (vendor.js:120), <anonymous>:2070:18)
    at NgSwitch._updateDefaultCases (eval at <anonymous> (vendor.js:120), <anonymous>:2181:29)
    at NgSwitch._matchCase (eval at <anonymous> (vendor.js:120), <anonymous>:2166:18)
    at NgSwitchCase.ngDoCheck (eval at <anonymous> (vendor.js:120), <anonymous>:2235:92)
    at checkAndUpdateDirectiveInline (eval at <anonymous> (vendor.js:21), <anonymous>:11062:19)
    at checkAndUpdateNodeInline (eval at <anonymous> (vendor.js:21), <anonymous>:12567:17)
    at checkAndUpdateNode (eval at <anonymous> (vendor.js:21), <anonymous>:12506:16)
    at debugCheckAndUpdateNode (eval at <anonymous> (vendor.js:21), <anonymous>:13370:59)
    at debugCheckDirectivesFn (eval at <anonymous> (vendor.js:21), <anonymous>:13311:13)
    at Object.eval [as updateDirectives] (FormComponent.html:42)
    at Object.debugUpdateDirectives [as updateDirectives] (eval at <anonymous> (vendor.js:21), <anonymous>:13296:21)
    at checkAndUpdateView (eval at <anonymous> (vendor.js:21), <anonymous>:12473:14)
    at callViewAction (eval at <anonymous> (vendor.js:21), <anonymous>:12841:21)
    at execEmbeddedViewsAction (eval at <anonymous> (vendor.js:21), <anonymous>:12799:17)
    at checkAndUpdateView (eval at <anonymous> (vendor.js:21), <anonymous>:12474:5)
    at callViewAction (eval at <anonymous> (vendor.js:21), <anonymous>:12841:21)
    at execComponentViewsAction (eval at <anonymous> (vendor.js:21), <anonymous>:12773:13)
    at checkAndUpdateView (eval at <anonymous> (vendor.js:21), <anonymous>:12479:5)
    at callViewAction (eval at <anonymous> (vendor.js:21), <anonymous>:12841:21)
    at execEmbeddedViewsAction (eval at <anonymous> (vendor.js:21), <anonymous>:12799:17)
    at checkAndUpdateView (eval at <anonymous> (vendor.js:21), <anonymous>:12474:5)
    at callViewAction (eval at <anonymous> (vendor.js:21), <anonymous>:12841:21)
    at execComponentViewsAction (eval at <anonymous> (vendor.js:21), <anonymous>:12773:13)
    at checkAndUpdateView (eval at <anonymous> (vendor.js:21), <anonymous>:12479:5)
    at callViewAction (eval at <anonymous> (vendor.js:21), <anonymous>:12841:21)
    at execComponentViewsAction (eval at <anonymous> (vendor.js:21), <anonymous>:12773:13)
    at checkAndUpdateView (eval at <anonymous> (vendor.js:21), <anonymous>:12479:5)
    at callWithDebugContext (eval at <anonymous> (vendor.js:21), <anonymous>:13696:42)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (eval at <anonymous> (vendor.js:21), <anonymous>:13236:12)
    at ViewRef_.detectChanges (eval at <anonymous> (vendor.js:21), <anonymous>:10392:18)
    at eval (eval at <anonymous> (vendor.js:21), <anonymous>:5015:63)
    at Array.forEach (<anonymous>)
    at ApplicationRef_.tick (eval at <anonymous> (vendor.js:21), <anonymous>:5015:25)
    at eval (eval at <anonymous> (vendor.js:21), <anonymous>:4887:106)
    at ZoneDelegate.invoke (eval at <anonymous> (polyfills.js:2692), <anonymous>:392:26)
    at Object.onInvoke (eval at <anonymous> (vendor.js:21), <anonymous>:4093:33)
    at ZoneDelegate.invoke (eval at <anonymous> (polyfills.js:2692), <anonymous>:391:32)
    at Zone.run (eval at <anonymous> (polyfills.js:2692), <anonymous>:142:43)
    at NgZone.run (eval at <anonymous> (vendor.js:21), <anonymous>:4024:69)
    at Object.next (eval at <anonymous> (vendor.js:21), <anonymous>:4887:82)
    at SafeSubscriber.schedulerFn [as _next] (eval at <anonymous> (vendor.js:21), <anonymous>:3838:52)
    at SafeSubscriber.__tryOrUnsub (eval at <anonymous> (vendor.js:14), <anonymous>:223:16)
    at SafeSubscriber.next (eval at <anonymous> (vendor.js:14), <anonymous>:172:22)
    at Subscriber._next (eval at <anonymous> (vendor.js:14), <anonymous>:125:26)
    at Subscriber.next (eval at <anonymous> (vendor.js:14), <anonymous>:89:18)
    at EventEmitter.Subject.next (eval at <anonymous> (vendor.js:51), <anonymous>:55:25)
    at EventEmitter.emit (eval at <anonymous> (vendor.js:21), <anonymous>:3824:76)
    at checkStable (eval at <anonymous> (vendor.js:21), <anonymous>:4058:35)
    at Object.onHasTask (eval at <anonymous> (vendor.js:21), <anonymous>:4106:21)
    at ZoneDelegate.hasTask (eval at <anonymous> (polyfills.js:2692), <anonymous>:445:37)
    at ZoneDelegate._updateTaskCount (eval at <anonymous> (polyfills.js:2692), <anonymous>:465:22)
    at Zone._updateTaskCount (eval at <anonymous> (polyfills.js:2692), <anonymous>:289:34)
    at Zone.runTask (eval at <anonymous> (polyfills.js:2692), <anonymous>:209:30)
    at drainMicroTaskQueue (eval at <anonymous> (polyfills.js:2692), <anonymous>:602:35)
    at ZoneTask.invokeTask [as invoke] (eval at <anonymous> (polyfills.js:2692), <anonymous>:503:21)
    at invokeTask (eval at <anonymous> (polyfills.js:2692), <anonymous>:1540:14)
    at XMLHttpRequest.globalZoneAwareCallback (eval at <anonymous> (polyfills.js:2692),

Same error in https://launch.prod-preview.openshift.io/filtered-wizard/all/launchpad-new-project/1/e30%3D:
core.es5.js:1020 ERROR Error: No provider for Boolean!
    at S (core.es5.js:1169)
    at O (core.es5.js:1207)
    at t._throwOrNull (core.es5.js:2649)
    at t._getByKeyDefault (core.es5.js:2688)
    at t._getByKey (core.es5.js:2620)
    at t.get (core.es5.js:2489)
    at qe (core.es5.js:9489)
    at t.get (core.es5.js:10577)
    at Tn (core.es5.js:11080)
    at xn (core.es5.js:10939)

fixed in https://github.com/fabric8-launch/launchpad-frontend/commit/4fe620036ac18cfedfab4c6d97dcac21fe851099

authors: edewit gastaldi


text:
fix(iteration-panel): Update the onscreen display text when no date has been set.

[x] What does this PR do?
fix(iteration-panel): Update the onscreen display text when no date has been set.

[x] What issue/task does this PR references?
https://github.com/openshiftio/openshift.io/issues/2292

@nimishamukherjee Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2800 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2800 and visit http://localhost:5000 to access it.

@nimishamukherjee Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2800 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2800 and visit http://localhost:5000 to access it.

authors: centos-ci nimishamukherjee


text:
Unable to run script.sh inside docker agent

When trying to run the following declarative pipeline:
pipeline {
    agent { docker 'alpine' }
    stages {
        stage('Test') {
            steps {
                sh('printenv')
            }
        }
    }
}

I get the error:
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Agent Setup)
[Pipeline] sh
[TmpTest] Running shell script
+ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
Digest: sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe
Status: Image is up to date for alpine:latest
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[TmpTest] Running shell script
+ docker inspect -f . alpine
.
[Pipeline] withDockerContainer
Jenkins does not seem to be running inside a container
$ docker run -t -d -u 107:113 -w /var/lib/jenkins/workspace/TmpTest -v /var/lib/jenkins/workspace/TmpTest:/var/lib/jenkins/workspace/TmpTest:rw,z -v /var/lib/jenkins/workspace/TmpTest@tmp:/var/lib/jenkins/workspace/TmpTest@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat alpine
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Provision Server)
[Pipeline] sh
[TmpTest] Running shell script
sh: /var/lib/jenkins/workspace/TmpTest@tmp/durable-1abfbc69/script.sh: not found
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
$ docker stop --time=1 db551b51404ba6305f68f9086320634eeea3d515be134e5e55b51c3c9f1eb568
$ docker rm -f db551b51404ba6305f68f9086320634eeea3d515be134e5e55b51c3c9f1eb568
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE

When monitoring the pipelines @tmp directory whilst its running I can see script.sh created.
some system details
Jenkins running as a single node system which has docker installed.
Jenkins v2.60.1
(all plugins fully updated)

docker --version
Docker version 17.06.0-ce, build 02c1d87

Same here, some fix?
My config:

Jenkins 2.60.2
Docker version 17.03.1-ce, build c6d412e

@tomdottom The docker image must have inside the jenkins agent ready for run. In my case, a workaround is use a custom Dockerfile with base of https://hub.docker.com/r/jenkinsci/slave/~/dockerfile/ and adding the things I need (docker for example).
Once you have a jenkins agent running inside the container, the sh will exec correctly.

@AndresCidoncha thanks for the suggested solution.

Is there any clue what the problem is?
@AndresCidoncha  Based on the docs(https://jenkins.io/doc/book/pipeline/docker/ ) using an image with a Jenkins agent ready is not necessary (if it would be, that make this a useless feature).
@bariman So I only have to change the global configuration of my whole Jenkins which affects all jobs? Why exactly? I have /bin/bash installed in my container if it were a dependency.

I had the same problem, and it was caused because the format of the bash script was incorrect.
I noticed it when I tried to run my script on my local computer and I saw the error message:
/bin/sh^M: bad interpreter: No such file or directory.
After to fix this issue my script was executed successfully.

authors: AndresCidoncha jlccx-incontact kassybas tomdottom


text:
Sync plugin throws exception for non-pipeline builds

When running a non-pipeline build from jenkins, this exception appears in the logs:
INFO: OpenShift Sample #1 main build action completed: FAILURE
Jul 12, 2016 1:37:24 PM hudson.model.listeners.RunListener report
WARNING: RunListener failed
java.lang.IllegalStateException: Cannot poll a non-workflow run
        at io.fabric8.jenkins.openshiftsync.BuildSyncRunListener.pollRun(BuildSyncRunListener.java:171)
        at io.fabric8.jenkins.openshiftsync.BuildSyncRunListener.onCompleted(BuildSyncRunListener.java:141)
        at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
        at hudson.model.Run.execute(Run.java:1783)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:410)

I don't think we should be reporting that error.
@jimmidyson

Released in 0.0.11 - available from https://repo.jenkins-ci.org/releases/io/fabric8/jenkins/plugins/openshift-sync/0.0.11/

thanks @jimmidyson!

authors: bparees jimmidyson


text:
How to use "buck2 clean" or other commands to delete only the generated files (cache) without killing the daemon?

Ask a question above，Thanks!

This is not a feature that exists in Buck2.
There is buck2 clean --stale that can clean files that were produced by a
previous daemon (assuming you’re using deferred materialization), but that
still won’t clear files the current daemon cares about.
If you think about it though, once you’ve cleared all the outputs there’s
not too much state left in the daemon (only loading and analysis), so what
you’re asking for might be a lot less useful than you think.
On Tue, 19 Mar 2024 at 05:47, yaoddao @.***> wrote:

Ask a question above，Thanks!
—
Reply to this email directly, view it on GitHub
https://github.com/facebook/buck2/issues/608, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANIHVS5BGTJQF3UYTVHADLYY67PLAVCNFSM6AAAAABE42GHXGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TIMBRGIYTONI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Yeah, agreed with Thomas. I think it would be good to know what the state that you are expecting to keep around is, we may be able to provide a more helpful answer then

authors: JakobDegen krallin yaoddao


text:
require('ts-pattern') not work on react-scripts 5 but work on react-scripts 4.

Describe the bug
const tsPattern = require('ts-pattern');
The tsPattern is a string but not a module on react-scripts 5, and other library is work.
Did you try recovering your dependencies?

(Write your answer here.)
Which terms did you search for in User Guide?

(Write your answer here if relevant.)
Environment

(paste the output of the command here.)
Steps to reproduce

(Write your steps here:)

npx create-react-app ts-pattern-test
cd ts-pattern-test
pnpm add ts-pattern
code in src/index.js:

const tsPattern = require('ts-pattern');

Expected behavior

The tsPattern should be a module be return a string on react-scripts 5, and other library is work.
Actual behavior

(Write what happened. Please add screenshots!)
Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Hi @ChengOuyang, I found this issue interesting so being here to help.
Firstly, I saw you were initializing the project directory ts-pattern-test with npx which is sub command of npm but the package ts-pattern was installed with pnpm add. Would you try another project directory with npm install -S to install ts-pattern so to keep the initialization command and the installation command consistent?
Secondly, I give a try with the codesandbox: https://codesandbox.io/s/brave-buck-g0cvb8?file=/src/App.js It seems that the package ts-pattern just works well. So, I believe the first tip might help you out. Let me know if you got any other problem.

esm import is work, but cjs require not work

Hi @ChengOuyang, I found this issue interesting so being here to help.
Firstly, I saw you were initializing the project directory ts-pattern-test with npx which is sub command of npm but the package ts-pattern was installed with pnpm add. Would you try another project directory with npm install -S to install ts-pattern so to keep the initialization command and the installation command consistent?
Secondly, I gave a try with the codesandbox: https://codesandbox.io/s/brave-buck-g0cvb8?file=/src/App.js It seems that the package ts-pattern just works well. So, I believe the first tip might help you out. Let me know if you got any other problem.

esm import is work, but cjs require not work

Emm..., changing import to require, I didn't see any difference though. Looks it still works: https://codesandbox.io/s/brave-buck-g0cvb8?file=/src/App.js

Hmm..., looks I can reproduce in my local. Looking into it...

Hmm..., looks I can reproduce in my local. Looking into it...

Reproduce the project below:
https://github.com/ChengOuyang/ts-pattern-test

Emm..., changing import to require, I didn't see any difference though. Looks it still works: https://codesandbox.io/s/brave-buck-g0cvb8?file=/src/App.js

I can't reproduce it on sanbox either, but I can reproduce it locally with cra……

Thanks @ChengOuyang. Let me take a look.

Looks when using require('ts-pattern'), dist/index.cjs in ts-pattern will get used. And, all .cjs files are treated as assets by CRA for now. So, the result is, you end up with a string.
By far, adding support for the .cjs file extension is getting handled by this PR https://github.com/facebook/create-react-app/pull/12021 but the PR remains not merged for quite a period. I don't know whether it will be merged some day.(Perhaps never, because it might be the expected way how CRA works. 🥲)
My suggestion is, you may stick to import instead of require as the esm format is always preferred today. But if you have to use require, you may import and export ts-pattern in another new file, then require this new file, like this: https://codesandbox.io/s/brave-buck-g0cvb8?file=/src/App.js

Thanks @ChengOuyang. Let me take a look.

Thanks

用的时候看require('ts-pattern')，dist/index.cjs在ts-pattern就会用。而且，目前所有.cjs文件都被 CRA 视为资产。所以，结果是，你最终得到了一个字符串。
到目前为止，此 PR #12021.cjs正在处理添加对文件扩展名的支持，但 PR 在相当长的一段时间内仍未合并。我不知道它是否会在某一天被合并。（也许永远不会，因为这可能是 CRA 工作的预期方式。🥲)
我的建议是，您可以坚持使用 esm 格式，import而不是require因为今天总是首选。但是如果你必须使用，你可以在另一个新文件中require导入和导出，然后这个新文件，像这样：https ://codesandbox.io/s/brave-buck-g0cvb8?file=/src/App.jsts-pattern``require

Thanks, this problem we found in the project is actually two problems:

The esm module was expected to be introduced, but the cjs module was introduced instead;
An error was found when importing the cjs module of ts-pattern;

We have solved problem 1, and the project is running normally, but problem 2 is rather strange, so I went to the official here to mention it...

For tip 1, the behavior of including which file is actually determined by the exports field in package.json. Here is how it works: https://webpack.js.org/guides/package-exports/.
For tip 2, yep, agree, it could feel a bit strange that .cjs file is not supported. Hoping this PR https://github.com/facebook/create-react-app/pull/12021 will get merged soon. 🙂

repo: facebook/create-react-app


text:
Documentation update regarding images below 10,000 bytes

Is this a bug report?
No, this is a documentation update suggestion
The following sentence should be updated to be more explicit:
To reduce the number of requests to the server, importing images that are less than 10,000 bytes returns a data URI instead of a path.
To this:
To reduce the number of requests to the server, importing images that are less than 10,000 bytes returns a data URI instead of a path, therefore these images will not be included in the build/static/media directory, but will be placed inline where they are used instead.

Please submit PR. Thanks

authors: Aperyon andriijas


text:
why there aren't webpack.config.dev.js and webpack.config.prod.js files in the config folder?

I want to use the CSS module for adding some CSS style to my component. I used "npm run eject" command, but in the config folder, I couldn't find webpack.config.dev.js and webpack.config.prod.js files. Of course, I'm using the latest version of reactjs.
I'm using this approach:
How to Use CSS Modules with Create React App

Those two files have been combined into a single config file named webpack.config.js in more recent versions of Create React App.

authors: farhadibehnam iansu


text:
eslint for...in / for...of false positive

Describe the bug
ESlint shows a no-unused-vars false positive with for-in loops.
Looks very similar to https://github.com/eslint/eslint/issues/12117
This issue didn't exist in react-scripts@3.0.0
Did you try recovering your dependencies?

Yes.
Which terms did you search for in User Guide?

N/A
Environment

Unfortunately, running   npx create-react-app --info throws the error shown further down.
I'm using react-scripts@3.1.1
Error from npx command
Environment Info:
(node:612) UnhandledPromiseRejectionWarning: Error: The system cannot find the path specified.
at Function.e.exports.sync (C:\Users\Shiraz.Esat\AppData\Roaming\npm\node_modules\create-react-app\node_modules\envinfo\dist\envinfo.js:1:7778)
at Object.copySync (C:\Users\Shiraz.Esat\AppData\Roaming\npm\node_modules\create-react-app\node_modules\envinfo\dist\envinfo.js:1:104976)
at Object.t.writeSync.e [as writeSync] (C:\Users\Shiraz.Esat\AppData\Roaming\npm\node_modules\create-react-app\node_modules\envinfo\dist\envinfo.js:1:123499)
at C:\Users\Shiraz.Esat\AppData\Roaming\npm\node_modules\create-react-app\node_modules\envinfo\dist\envinfo.js:1:124274
at Promise.all.then.e (C:\Users\Shiraz.Esat\AppData\Roaming\npm\node_modules\create-react-app\node_modules\envinfo\dist\envinfo.js:1:124289)
at process._tickCallback (internal/process/next_tick.js:68:7)

(node:612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:612) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Steps to reproduce

Create a simple function in your CRA project with something like:
    export function simple() {
      const iterate = { prop: "value" };
      for (const item in iterate) {
        console.log(item);
      }
    }

Run npm start
Expected behavior

No ESLint warnings should be shown. item is used.
Actual behavior

Compiled with warnings.
./src/utils/file.js
Line 3:    'item' is defined but never used  no-unused-vars
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

https://github.com/eslint/eslint/issues/12117
downgrading from eslint 6.2.0 to 6.1.0 fixes the issue

Does anyone know of a temporary work-around for this?
I tried downgrading and locking react-scripts to 3.1.0 and eslint to 6.1.0. It production-builds fine locally (though still throws compile errors, which it shouldn't after downgrading?), but on CI it throws compile errors AND fails to compile.
I've tried turning off no-unused-vars in my .eslintrc file, but it seems like react-scripts doesn't even respect the rules there?
I don't have much experience configuring create-react-app, so any insight or direction would be appreciated.

I am seeing the same but for a for-of loop. If this is verified think of renaming the issue so that others facing the same problems can more easily find it.
for (const item of items) {
        console.log(item);
}

resolutions didn't work for me, as reported on #7648.  react-scripts build looks for an exact version:
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "babel-eslint": "10.0.2"

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-eslint was detected higher up in the tree:

  /app/frontend/node_modules/babel-eslint (version: 10.0.3)

Manually installing incompatible versions is known to cause hard-to-debug issues.
...

#7594 resolves this issue but it not merged/released yet. As a workaround I published it on npm and use it until a newer react-scripts is released with a fix. https://www.npmjs.com/package/@madmed88/react-scripts

You can also use SKIP_PREFLIGHT_CHECK=true to avoid the issue mentioned by @jwhitlock. For the proper solution see #7594. Let’s get it merged!

We had just one false positive in our codebase, so a pair of /* eslint-disable no-unused-vars */ / /* eslint-enable no-unused-vars */ comments worked:
https://github.com/mozilla-services/tecken/pull/1864/commits/36a642594fbebc1d8065eadc56f3b3edd3301296

Just curious what the ETA is for publishing the patch?

authors: Shannanigans bdharrington7 esetnik jwhitlock madmed88 shiraze vincerubinetti


text:
feat(v2): add announcement bar

Motivation
Resolve https://docusaurus.canny.io/admin/board/feature-requests/p/announcement-bar
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

FYI may not be the best solution because sticky navbar here makes it difficult to "elegantly" implement such a thing. Any improvements are welcome!

@yangshun It was a bit tricky, but now it really got better, re-check it please.

I think there's a bug - after I dismiss the announcement bar and refresh the page, the page layout goes haywire totally.

I'll see what is wrong 😱 😱 😱 . But why is the current code bad?

@yangshun I fixed all the bugs, now it should be fine, check again please.

Reworked PR according to new changes (navbar via sticky positioning)

Serializing the content to use as a key is less work, but letting the user specify a key is still better. If the user had a typo and they fixed it later on, the announcement shows up twice

This is an additional work for user, since in addition to the announcement text, they needs to specify a new id. It seems to me serialization would be enough, because, for example, typos is a rare use case..

@yangshun I reworked component (using ids, styles, updating docs). I think it would be nice to delivery this feature in a new release.

Apparently we need to add a shadow or border for better view in light mode :thinking:

@lex111 this is awesome! I personally think it might look nice in the same color of the search bar, which is (I think) var(--ifm-navbar-search-input-background-color)

repo: facebook/docusaurus


text:
Add accessible label for Algolia search button

Motivation
The Algolia search button doesn't contain text which fails lighthouse a11y tests + isn't nice for screen readers.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
This has just been tested manually by checking the markup and running lighthouse.
After

Before

Markup

Related PRs
N/A

@yangshun - I've signed the contributor agreement. Are you able to re run that check?

Thanks
@francoischalifour isn't it something you would like to fix in DocSearchButton directly?

🤪 😅
so @francoischalifour if it was not the right fix, you can remove it

Thank you @hobadams.
@slorber I included this fix in the next version of DocSearch, I'll make sure to remove this line when I'll bump the DocSearch version on Docusaurus.

authors: francoischalifour hobadams slorber


text:
docs: update outdated links in showcase

Pre-flight checklist

[x] I have read the Contributing Guidelines on pull requests.
[ ] If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
[ ] If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation
The current link for the Homarr documentation source code is broken. Additionally, the webpage link is slightly outdated.

Signed CLA 👍

Thanks 👍


text:
flow error: expected array of arguments instead of Uint8Array

I believe Flow is incorrectly reporting the following error:
call of method 'apply'. expected array of arguments instead of Uint8Array
The code:
function decodeutf8(uint8 :Uint8Array) :string {
  const utf8String = String.fromCharCode.apply(null, uint8); // problematic line
  return decodeUTF8(utf8String);
}

The uint8 parameter is a typed array, so it should satisfy the expected array of arguments. However, Flow's definition for fromCharCode doesn't support typed arrays:
https://github.com/facebook/flow/blob/master/lib/core.js#L266
static fromCharCode(...codes: Array<number>): string;
Any suggestions on how this should be handled?

Hmm, it seems to be part of a specification that the argument to apply only needs to be "array-like": http://www.ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike
TIL.
I think the way to fix this would be to change how apply is handled in Flow to match the spec, and possibly make a few other changes to the type definition of Array and Uint8Array (etc.) to adjust if necessary.
Workaround for now would be to wrap the occurrence of uint8 passed to apply as (uint8: any).

repo: facebook/flow


text:
Non-nullable instance variables should be set in the constructor.

The example is below.
https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjGBDAzrsAWQE8BhHfMAb1TDABcBTXegLjADsBXAWwCNGAJwDc6OoK4cAFAEpqtOmAxwOLMMTABeMAEYwAagYALAJa4AdExajFSlbjgxG5+AHMpAcnqmLV+h4AadRkbMABfVAjMe3owHjIKAm0ORiQScjxcWVF4jPxzCWkQoA
Flow should ensure that test is set in the constructor.

Yes! This issue has been on the TODO list for a while. Will see if we can get it expedited.

Duplicate of https://github.com/facebook/flow/issues/650

authors: avikchaudhuri vishnevskiy vkurchatkin


text:
Definition of process.stdin.setRawMode is not respected

With code below
// @flow

if (process.stdin.isTTY) {
  process.stdin.setRawMode(true);
}

I got following error:
index.js:4
  4:   process.stdin.setRawMode(true);
                     ^^^^^^^^^^ property `setRawMode`. Property not found in
  4:   process.stdin.setRawMode(true);
       ^^^^^^^^^^^^^ stream$Readable

Definition of setRawMode method is present and process.stdin definition is also there, but for some reason flow treats stdin as stream$Readable, not tty$ReadStream

@R1ZZU process.stdin is not always a tty stream, so this is actually correct. To make your example work we need to make process.stdin a union

process.stdin is already a union:
declare class Process extends events$EventEmitter {
    ...
    stdin : stream$Readable | tty$ReadStream;
    ...
}

Am I missing something?

No, it's just not enough to make refinement work, unfortunately

I've found a workaround, but not sure if it safe enough... Any thoughts? 💭
declare class ReadableOrTTY extends stream$Readable mixins tty$ReadStream {};

declare class PatchedProcess {
	stdin: ReadableOrTTY
}

declare var process: Process & PatchedProcess;

I'm encountering the same issue.
My workaround is (I only class setRawMode once in my applicaiton):
if (process.stdin.setRawMode && typeof process.stdin.setRawMode === 'function') {
    process.stdin.setRawMode(true);
}

This is pretty much the same as:
if (process.stdin.isTTY) {
  (process.stdin: any).setRawMode(true);
}

authors: R1ZZU Spy-Seth vkurchatkin


text:
JSX elements with a period in the name don't type check

Not sure if this is a bug or just a design decision, but wanted to report it anyway. Components with names such as Component.SubComponent aren't properly typechecked.
Pseudo code setup:
class SectionHeader extends Component {
  props: {
    label: string
  };
}

class Section extends Component {
  static Header = SectionHeader;
}

In use:
import Section from 'somewhere';
const { Header } = Section;

class OtherComponent extends Component {
  render() {
    return (
      <Section>
        <Header foo="bar" /> // Works, type checks as expected
        <Section.Header foo="bar" /> // Doesn't work, no type checking happens
      </Section>
    );
  }
}

Duplicate of https://github.com/facebook/flow/issues/1113

authors: chrissnyder vkurchatkin


text:
Combining array destructing and union type does not work

These are working:
const [value1]: ['A'] = ['A'];
const [value2_1]: ['A' | 'B'] = ['A'];
const [value2_2]: ['A' | 'B'] = ['B'];
const value3_1: ['A'] | ['B'] = ['A'];
const value3_2: ['A'] | ['B'] = ['B'];

But, this is an error.
const [value4]: ['A'] | ['B'] = ['A'];

Try Flow:
https://flow.org/try/#0PTAEAEDMBsHsHcBQiDGsB2BnALqA2gG4CG0ArgKYCMAugFz4DkAgg9aALyMvUDcqGOfMTLkATAH0a9PMwagAPqAYAhVhy6s+aLLkIkKE0XQ0KlqtpxnmtA3MIoBmSdNltFVtZdc2doe+SdRF25TDwtGa2RtQT0RABZjGRD3FU8NXiA
In addition, I used flow-bin@0.51.0.
Thanks.

now all of them work


text:
Update Copyright in Footer

Updated Copyright from 2016 to 2017.

Could use {{ site.time | date: '%Y' }} instead of hard-coding the current year?

Agree that having it dynamic is better 👍
Do you know if {{ site.time | date: '%Y' }} will work for sure or will I have to run the project locally to double check?

@peduarte Yes, I just double-checked and that works fine. I found these files where it will need updating:

website/_includes/footer.html
website/_layouts/try.html
website/index.doc.js

authors: davecardwell peduarte


text:
Fix flow-remove-types for input with multi-byte characters

Closes #7779 by implementing the approach described by @mroch in https://github.com/facebook/flow/issues/7779#issuecomment-498290377.
Remaining work:

[ ] Try eliminating all string manipulation and buffer.write calls in favor of purely byte-based operations for performance. Not worth it — bottleneck is in parsing.
[x] Benchmark the change to make sure performance didn't regress.
[ ] Address any review suggestions.
[x] Sign the CLA.

@mroch this is ready for review. While the performance didn't regress, there's no point in optimizing the code much because almost all time is spent in flow-parser. Preliminary benchmarks show that it's about 4–5 times slower than the previous flow-remove-type version based on babylon. 😭

The build failed for some reasons unrelated to the PR changes it seems.

@mourner have you still got time to look into this and address the comments?

@thehogfather apologies — can't get to it at the moment but hopefully I'll find some time in a week or two. The only comment left unaddressed is this one:

How does this issue translate to source maps? I'm suddenly worried that the source map spec is silent on what "columns" mean, but I'd imagine it's meant to be interpreted more like "code points" than "bytes". So we might need to do some Unicode bookkeeping in generateSourceMappings as well.

If anyone's up to helping out on the source maps part, I'd appreciate it!

authors: mourner thehogfather


text:
Add JSCS tests

Since contributing guide mentions code style rules, it worth to add JSCS style checking:
{
    "esnext": true,
    "validateIndentation": 2,
    "maximumLineLength": 80,
    "validateQuoteMarks": "'",
    "requireSemicolons": true,
    "requireCommaBeforeLineBreak": true
}

Since this is a "stylistic suggestion" and super old I am going to close the issue. Thanks for bringing this up!

authors: lacker vtambourine

repo: facebook/immutable-js


text:
https://jestjs.io/docs/en/tutorial-react contains nonsense

Just before "DOM Testing" it contains the sentence:
Another option is to swizzling console.warn and supress specific warnings.
... Where "swizzling" is not a thing in this context and is worse than unhelpful and "+swizzling console.warn" brings up zero google results, and suppress is misspelled.

@onexdata thanks for reporting, want to submit a PR to change?

Hello @rickhanlonii, I have created a PR for the documentation update. Please review and approve.

authors: monish001 onexdata rickhanlonii

repo: facebook/jest


text:
Ignore dot dirs default

Fixes: #3827
Summary
Makes jest ignore directories that start with a . by default in addition to ignoring node_modules. Ex: .cache
Motivation
When $HOME is the same as the application directory yarn will default to putting its cache directory at $APP_DIR/.cache/yarn/v1/... and Jest will pick up tests in dependencies.
This happens to users trying to use Jest with Heroku CI, where $HOME is /app. Currently any user using both yarn and jest will hit this issue in that environment.
Test plan

Added unit tests
yarn test

Codecov Report

Merging #3935 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #3935   +/-   ##
======================================
  Coverage    58.1%   58.1%
======================================
  Files         196     196
  Lines        6752    6752
  Branches        6       6
======================================
  Hits         3923    3923
  Misses       2826    2826
  Partials        3       3

Impacted Files
Coverage Δ

packages/jest-config/src/defaults.js
100% <ø> (ø)
:arrow_up:

packages/jest-config/src/valid_config.js
100% <ø> (ø)
:arrow_up:

packages/jest-config/src/constants.js
100% <ø> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac25993...527ff8a. Read the comment docs.

Thank you but I don't believe I'd like to set this as default behavior at this point.

authors: codecov-io cpojer jmorrell