Nx run storybook does nothing and terminates - storybook

I'm trying to add storybook support to an existing Nx Angular project. More specifically, to a library called ui. Following the docs, I ran:
$ npm i -D #nrwl/storybook
$ nx g #nrwl/angular:storybook-configuration project-name
The .storybook folder was successfully generated under the ui library. I added a *.component.story.ts file to one of my components folder. But then, when I run nx run ui:storybook, it does nothing and just terminates, as shown belown:
How do I fix this?
Nx Report Output
> NX Report complete - copy this into the issue template
Node : 14.15.4
OS : win32 x64
npm : 6.14.10
nx : Not Found
#nrwl/angular : 11.0.20
#nrwl/cli : 11.0.20
#nrwl/cypress : 11.0.20
#nrwl/devkit : 11.0.20
#nrwl/eslint-plugin-nx : 11.0.20
#nrwl/express : Not Found
#nrwl/jest : 11.0.20
#nrwl/linter : 11.0.20
#nrwl/nest : Not Found
#nrwl/next : Not Found
#nrwl/node : Not Found
#nrwl/react : Not Found
#nrwl/schematics : Not Found
#nrwl/tao : 11.0.20
#nrwl/web : Not Found
#nrwl/workspace : 11.0.20
typescript : 4.0.5

Can you, first, try to fix the name of your story file? The files that are recognized as story files, are files ending in .stories.ts. You can actually look into your .storybook/main.js file of your library, and see the pattern of story files that are getting read.
However, I believe you should still be getting a warning like "no stories were found". If you change the file name to be correct, and run again, and it still fails to do anything, can you please run nx report and post the result here?

Related

Why is blogdown putting a mamba command through normalizePath?

Here's what I'm doing:
I have a blog that uses blogdown to render .Rmd files.
Some of the code snippets in the blog are in Python. I'm using reticulate for that.
I'm using a GitHub workflow to build and publish the blog as part of a larger website. This workflow sets up the environment and package dependencies in miniconda.
The last time this ran was six months ago. At that time, it worked. Now, it does not. I can't seem to replicate the behavior locally for more detailed debugging.
It seems to be trying to put a mamba command into normalizePath instead of a filesystem path (www-main is the name of the repository):
conda activate www-main
Rscript -e 'blogdown::build_site(local=FALSE, run_hugo=FALSE, build_rmd="content/blog/2020-08-28-api.Rmd")'
shell: /usr/bin/bash -l {0}
env:
CONDA_PKGS_DIR: /home/runner/conda_pkgs_dir
Rendering content/blog/2020-08-28-api.Rmd...
[...]
Quitting from lines 401-410 (2020-08-28-api.Rmd)
Error in normalizePath(conda, winslash = "/", mustWork = TRUE) :
path[1]="# cmd: /usr/share/miniconda/condabin/mamba update --name www-main --file /home/runner/work/www-main/www-main/conda": No such file or directory
Calls: local ... python_munge_path -> get_python_conda_info -> normalizePath
Execution halted
Error: Failed to render content/blog/2020-08-28-api.Rmd
Execution halted
Lines 401-410 of 2020-08-28-api.Rmd are a Python code block:
400 ```{python python-data, dev='svg'}
401 import covidcast
402 from datetime import date
403 import matplotlib.pyplot as plt
404
405 data = covidcast.signal("fb-survey", "smoothed_hh_cmnty_cli",
406 date(2020, 9, 8), date(2020, 9, 8),
407 geo_type="state")
408 covidcast.plot_choropleth(data, figsize=(7, 5))
409 plt.title("% who know someone who is sick, Sept 8, 2020")
410 ```
The useful bits of the output of conda info, in case it helps:
active environment : www-main
active env location : /usr/share/miniconda/envs/www-main
shell level : 1
user config file : /home/runner/.condarc
populated config files : /home/runner/.condarc
conda version : 4.12.0
conda-build version : not installed
python version : 3.9.12.final.0
virtual packages : __linux=5.15.0=0
__glibc=2.31=0
__unix=0=0
__archspec=1=x86_64
base environment : /usr/share/miniconda (writable)
conda av data dir : /usr/share/miniconda/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/runner/conda_pkgs_dir
envs directories : /usr/share/miniconda/envs
/home/runner/.conda/envs
platform : linux-64
user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.12 Linux/5.15.0-1020-azure ubuntu/20.04.5 glibc/2.31
UID:GID : 1001:121
netrc file : None
offline mode : False
I found this, but their workaround doesn't make sense for me since I'm not using papermill: https://github.com/rstudio/reticulate/issues/1184
I found this, but my paths don't have spaces: https://github.com/rstudio/reticulate/issues/1149
I found this, but their problem includes an entirely reasonable value for path[1], unlike mine: How can I tell R where the conda environment is via a docker image?
The build environment for this is a bit of a bear but I can probably put together a minimum working (/nonworking) example if needed, lmk
I tracked this down to at least two bits of weird/buggy behavior in reticulate and found a workaround: switch from vanilla miniconda to Mambaforge.
The TL;DR seems to be that whatever wacky ubuntu-latest setup-miniconda#v2 environment started putting into meta/history doesn't include a create line, which is what reticulate needs in order to figure out which conda goes with which python, because (1) it ignores the reticulate.conda_binary setting for some reason, and (2) it uses a more restrictive regex to parse the lines of the history file than the regex it uses to select them. Mambaforge does include the create line, so reticulate is happy.
- uses: conda-incubator/setup-miniconda#v2
with:
python-version: 3.9
activate-environment: www-main
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
use-only-tar-bz2: true # (for caching support)
- name: Update environment
run: mamba env update -n www-main -f environment.yml

Error in SaveSWF {animation}

I'm trying to use the code published on http://yihui.name/en/2009/12/merry-christmas-using-r/ but I end up with the following error:
In saveSWF({ : the executablepng2swf.exedoes not exist!
What can I do about it? Should I install the SWFTolls?
That means saveSWF() cannot find SWF Tools, and you should either put
it on PATH or provide its installation path. See swftools in
?animation::saveSWF
from http://r.789695.n4.nabble.com/Warning-Message-In-saveSWF-the-executablepng2swf-exedoes-not-exist-td4690755.html

Error deployApp when uploading bundle for application - shinyapp

I'm trying for the first time to deploy an App on ShinyApp.io and I manage some issues do it.
I ran the command :
>shinyapps::deployApp('C:/Users/Karim/Documents/test')
And the following message appeared :
Preparing to deploy application...DONE
Uploading bundle for application: 66633...
Error in digest::digest(file.path(appDir, file), algo = "md5", file = TRUE) :
The file does not exist: C:\WINDOWS\TEMP\RtmpugxfSW\fileabc59e7164e/..
I noted that the file mentioned (C:\Windows\Temp...) does exist and contains ui and server files. Yet I don't know which file is missing.
I tried to see if there was no similar cases in the forum by I didn't find similar mistakes.
If anyone know how to solve this error or guide me.
Thank you in advance.
Karim.
Try using relative rather than absolute paths,
https://support.rstudio.com/hc/en-us/articles/229848967-Why-does-my-app-work-locally-but-not-on-shinyapps-io-

how to edit data in R?

> edit(data.frame())
Error in dataentry(datalist, modes) : invalid device
In addition: Warning message:
In edit.data.frame(data.frame()) : unable to open X Input Method
my system is: debian6.04+R-2.15.1
what is the matter?
If you are on a MAC and just installed XQuartz, you must restart your computer to get the X11 capabilities.
I experienced exactly the same problem on linux and I noticed that it was a problem of input and locale settings. I solved by clearing the following variables in the environment
$ export XMODIFIERS=
$ export GTK_IM_MODULE=
Then it worked fine.

Tracd creating Environment

I was trying to create a Tracd Environment using the following command :
trac-admin D:\My_Project initenv
I get an error saying
Import Error : No module named pkg_resources
What am I missing? I have installed Genshi and Python 2.5.2
Thanks...
Read the Trac wiki. You need setuptools, which you can download here.

Resources