Generating a new ServiceStack React Project is missing SharpPagesFeature - reactjs

I updated to the latest #servicestack/cli
npm install -g #servicestack/cli
+ #servicestack/cli#1.0.8
updated 5 packages in 5.862s
Ran the dotnet-new command:
C:\Projects\Personal> dotnet-new react-spa POETS
> uglifyjs-webpack-plugin#0.4.6 postinstall C:\Projects\Personal\POETS\POETS\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
> poets#0.1.0 postinstall C:\Projects\Personal\POETS\POETS
> npm run build
> poets#0.1.0 build C:\Projects\Personal\POETS\POETS
> rimraf wwwroot/ && react-scripts-ts build && (move build wwwroot || mv build wwwroot)
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ts-loader: Using typescript#3.2.4 and C:\Projects\Personal\POETS\POETS\tsconfig.prod.json
Compiled successfully.
File sizes after gzip:
80.72 KB build\static\js\main.5832e8d6.js
29.7 KB build\static\css\main.4df18a76.css
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
1 dir(s) moved.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 1564 packages in 27.283s
MSBuild auto-detection: using msbuild version '16.0.360.33175' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\bin'.
Restoring packages for C:\Projects\Personal\POETS\POETS.ServiceInterface\POETS.ServiceInterface.csproj...
Restoring packages for C:\Projects\Personal\POETS\POETS.Tests\POETS.Tests.csproj...
Restoring packages for C:\Projects\Personal\POETS\POETS\POETS.csproj...
Restoring packages for C:\Projects\Personal\POETS\POETS.ServiceModel\POETS.ServiceModel.csproj...
GET https://api.nuget.org/v3-flatcontainer/servicestack.kestrel/index.json
GET https://api.nuget.org/v3-flatcontainer/servicestack/index.json
GET https://api.nuget.org/v3-flatcontainer/nunit/index.json
GET https://api.nuget.org/v3-flatcontainer/microsoft.net.test.sdk/index.json
GET https://api.nuget.org/v3-flatcontainer/nunit3testadapter/index.json
GET https://api.nuget.org/v3-flatcontainer/servicestack.interfaces/index.json
OK https://api.nuget.org/v3-flatcontainer/servicestack.kestrel/index.json 194ms
GET https://api.nuget.org/v3-flatcontainer/servicestack.kestrel/5.4.0/servicestack.kestrel.5.4.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/nunit/index.json 237ms
OK https://api.nuget.org/v3-flatcontainer/microsoft.net.test.sdk/index.json 246ms
OK https://api.nuget.org/v3-flatcontainer/nunit3testadapter/index.json 248ms
OK https://api.nuget.org/v3-flatcontainer/servicestack.interfaces/index.json 263ms
GET https://api.nuget.org/v3-flatcontainer/servicestack.interfaces/5.4.0/servicestack.interfaces.5.4.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/servicestack/index.json 318ms
GET https://api.nuget.org/v3-flatcontainer/servicestack/5.4.0/servicestack.5.4.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/servicestack.kestrel/5.4.0/servicestack.kestrel.5.4.0.nupkg 162ms
OK https://api.nuget.org/v3-flatcontainer/servicestack.interfaces/5.4.0/servicestack.interfaces.5.4.0.nupkg 149ms
OK https://api.nuget.org/v3-flatcontainer/servicestack/5.4.0/servicestack.5.4.0.nupkg 151ms
Installing ServiceStack.Interfaces 5.4.0.
GET https://api.nuget.org/v3-flatcontainer/servicestack.client/index.json
GET https://api.nuget.org/v3-flatcontainer/servicestack.common/index.json
OK https://api.nuget.org/v3-flatcontainer/servicestack.client/index.json 158ms
GET https://api.nuget.org/v3-flatcontainer/servicestack.client/5.4.0/servicestack.client.5.4.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/servicestack.common/index.json 173ms
GET https://api.nuget.org/v3-flatcontainer/servicestack.common/5.4.0/servicestack.common.5.4.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/servicestack.client/5.4.0/servicestack.client.5.4.0.nupkg 148ms
OK https://api.nuget.org/v3-flatcontainer/servicestack.common/5.4.0/servicestack.common.5.4.0.nupkg 146ms
GET https://api.nuget.org/v3-flatcontainer/servicestack.text/index.json
OK https://api.nuget.org/v3-flatcontainer/servicestack.text/index.json 159ms
GET https://api.nuget.org/v3-flatcontainer/servicestack.text/5.4.0/servicestack.text.5.4.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/servicestack.text/5.4.0/servicestack.text.5.4.0.nupkg 162ms
Committing restore...
Generating MSBuild file C:\Projects\Personal\POETS\POETS.ServiceModel\obj\POETS.ServiceModel.csproj.nuget.g.props.
Generating MSBuild file C:\Projects\Personal\POETS\POETS.ServiceModel\obj\POETS.ServiceModel.csproj.nuget.g.targets.
Writing lock file to disk. Path: C:\Projects\Personal\POETS\POETS.ServiceModel\obj\project.assets.json
Restore completed in 1.79 sec for C:\Projects\Personal\POETS\POETS.ServiceModel\POETS.ServiceModel.csproj.
Installing ServiceStack.Text 5.4.0.
Installing ServiceStack.Client 5.4.0.
Installing ServiceStack.Common 5.4.0.
Installing ServiceStack 5.4.0.
Installing ServiceStack.Kestrel 5.4.0.
Committing restore...
Generating MSBuild file C:\Projects\Personal\POETS\POETS.ServiceInterface\obj\POETS.ServiceInterface.csproj.nuget.g.props.
Generating MSBuild file C:\Projects\Personal\POETS\POETS.ServiceInterface\obj\POETS.ServiceInterface.csproj.nuget.g.targets.
Writing lock file to disk. Path: C:\Projects\Personal\POETS\POETS.ServiceInterface\obj\project.assets.json
Restore completed in 2.82 sec for C:\Projects\Personal\POETS\POETS.ServiceInterface\POETS.ServiceInterface.csproj.
Committing restore...
Generating MSBuild file C:\Projects\Personal\POETS\POETS.Tests\obj\POETS.Tests.csproj.nuget.g.props.
Generating MSBuild file C:\Projects\Personal\POETS\POETS.Tests\obj\POETS.Tests.csproj.nuget.g.targets.
Writing lock file to disk. Path: C:\Projects\Personal\POETS\POETS.Tests\obj\project.assets.json
Restore completed in 2.84 sec for C:\Projects\Personal\POETS\POETS.Tests\POETS.Tests.csproj.
Committing restore...
Generating MSBuild file C:\Projects\Personal\POETS\POETS\obj\POETS.csproj.nuget.g.props.
Generating MSBuild file C:\Projects\Personal\POETS\POETS\obj\POETS.csproj.nuget.g.targets.
Writing lock file to disk. Path: C:\Projects\Personal\POETS\POETS\obj\project.assets.json
Restore completed in 2.86 sec for C:\Projects\Personal\POETS\POETS\POETS.csproj.
NuGet Config files used:
C:\Projects\Personal\POETS\NuGet.Config
C:\Users\willi\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
https://api.nuget.org/v3/index.json
Installed:
1 package(s) to C:\Projects\Personal\POETS\POETS.ServiceModel\POETS.ServiceModel.csproj
5 package(s) to C:\Projects\Personal\POETS\POETS.ServiceInterface\POETS.ServiceInterface.csproj
6 package(s) to C:\Projects\Personal\POETS\POETS.Tests\POETS.Tests.csproj
5 package(s) to C:\Projects\Personal\POETS\POETS\POETS.csproj
Opened the App in Visual Studio 2017, and have a missing dependency for SharpPagesFeature.
public override void Configure(Container container)
{
Plugins.Add(new SharpPagesFeature()); // <--- Can't resolve this
SetConfig(new HostConfig
{
AddRedirectParamsToQueryString = true,
DebugMode = AppSettings.Get(nameof(HostConfig.DebugMode), false)
});
}
Does anyone know what package this is from? I see on GitHub that SharpPagesFeature is in the main namespace (ServiceStack).
EDIT
Additionally, the generated MyService.cs has incorrect dependencies and missing imports:
using ServiceStack.Script; <--- this can't be resolved and is unused
new PageResult(Request.GetPage("/")); <-- this requires me to import ServiceStack.Templates.PageResult (which resolves fine)

You have an old pre-release v5.4.1 of ServiceStack installed.
You'll need to clear your NuGet packages cache to install the latest version, e.g:
$ nuget locals all -clear

Related

Deploy React app with gh-pages after moving local folder

I'm having trouble deploying my React app with gh-pages since I moved my local directory from the main disk to a secondary disk on my laptop (I was running out of space).
Directory: https://github.com/jorislimonier/jorislimonier.github.io/
Here is the output of npm run deploy:
joris#joris-N751JK:/media/joris/projects/personal-website$ npm run deploy
> joris.limonier.github.io#0.1.0 predeploy
> npm run build
> joris.limonier.github.io#0.1.0 build
> react-scripts build
Creating an optimized production build...
warn - The `content` option in your Tailwind CSS configuration is missing or empty.
warn - Configure your content sources or your generated CSS will be missing styles.
warn - https://tailwindcss.com/docs/content-configuration
Compiled successfully.
File sizes after gzip:
75.73 kB build/static/js/main.27c91ea0.js
12.63 kB build/static/css/main.5cfc2ee1.css
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
https://cra.link/deployment
> joris.limonier.github.io#0.1.0 deploy
> gh-pages -d build
Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the "repo" option).
I tried:
git remote remove origin
git remote add origin https://github.com/jorislimonier/jorislimonier.github.io.git
Any idea?

React Native: XCode: Build failed with error "EMFILE: too many open files, watch"

– MackBook Air M1
– macOS 11.3
– XCode 12.5
– react native 0.64.1
– node 16.0.0
– npm 7.15.1
– watchman 2021.05.31.00
When I try to archive a project or build one for a device, Xcode stops building with an error:
/Users/aptyp/Projects/Proffmylife/Client/node_modules/metro-hermes-compiler/src/emhermesc.js:81
throw ex;
^
Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError (/Users/aptyp/Projects/Proffmylife/Client/node_modules/sane/src/node_watcher.js:143:12)
at FSWatcher.emit (node:events:365:28)
at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:210:12) {
errno: -24,
syscall: 'watch',
code: 'EMFILE',
filename: null
}
Command PhaseScriptExecution failed with a nonzero exit code
But for the simulator, the build works fine.
I have tried to reinstall node_modules, Pods, watchman with brew. Also I've created files limit.maxfiles.plist, limit.maxproc.plist into dir /Library/LaunchDaemons/ and now ulimit -a shows processes 2000 and file descriptors 524288. Restarting computer and unlock Keychain.
On my PC with Hackintosh I don't have this problem.
This error is because of a bug in module fsevents for mac m1 silicon. See the thread: https://github.com/facebook/metro/issues/668
It got fixed with new version of watchman. Upgrade your watchman through brew. Delete your project and download from git and rebuild everything along with pod install and then it should archive no problem.
Facebook guy admitting to the bug and fixing it
I created a new project with the same name, installed all the latest packages and copied the code. Only after that the project was built success.

Deploy React JS SPA in Openshift

I have build a React JS app and triggered yarn build command. Its builded successfully and if I run yarn global add serve, its working perfectly on http://localhost:5000. After that I tried below link to deploy this code to OpenShift.
OpenShift Deployment
According to the document, I tried to run npx nodeshift --strictSSL=false --dockerImage=bucharestgold/centos7-s2i-web-app --imageTag=10.13.0 --build.env YARN_ENABLED=true --expose
Then I got this log -
npx: installed 216 in 37.284s
kubernetes-client deprecated require('kubernetes-client').config, use require('kubernetes-client/backends/request').config. ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\openshift-rest-client\lib\openshift-rest-client.js:25:35
kubernetes-client deprecated require('kubernetes-client').config, use require('kubernetes-client/backends/request').config. ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\openshift-rest-client\index.js:23:39
2019-12-21T11:58:07.841Z INFO loading configuration
kubernetes-client deprecated fromKubeconfig see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig- ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\lib\nodeshift-config.js:35:32
2019-12-21T11:58:07.882Z INFO using namespace smart-learner at https://c101-e.jp-tok.containers.cloud.ibm.com:30512
kubernetes-client deprecated Client({ config }), see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\openshift-rest-client\lib\openshift-rest-client.js:95:18
kubernetes-client deprecated Request() without a .kubeconfig option, see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\kubernetes-client\lib\swagger-client.js:200:19
2019-12-21T11:58:07.928Z WARNING a file property was not found in your package.json, archiving the current directory.
2019-12-21T11:58:07.929Z INFO creating archive of .gitignore, build, Dockerfile, package-lock.json, package.json, public, README.md, src, yarn.lock
2019-12-21T11:58:09.001Z INFO using existing build configuration smartlearner-s2i
2019-12-21T11:58:09.377Z INFO using existing image stream smartlearner
2019-12-21T11:58:09.378Z INFO uploading binary archive C:\ReactAPP\smartlearner/tmp/nodeshift/build/archive.tar
2019-12-21T11:58:15.825Z INFO binary upload complete
2019-12-21T11:58:15.828Z INFO waiting for build to finish
kubernetes-client deprecated .getStream use .getByteStream, see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\lib\build-watcher.js:56:107
2019-12-21T11:58:19.798Z TRACE Using bucharestgold/centos7-s2i-web-app:10.x as the s2i builder image
2019-12-21T11:58:20.550Z TRACE ls: cannot access /tmp/src/node_modules: No such file or directory
2019-12-21T11:58:20.564Z TRACE ---> Installing application source
2019-12-21T11:58:20.585Z TRACE ---> Building your Web Application from source
2019-12-21T11:58:20.592Z TRACE Current git config
2019-12-21T11:58:20.620Z TRACE url.https://github.com.insteadof=git#github.com:
2019-12-21T11:58:20.629Z TRACE url.https://.insteadof=ssh://
2019-12-21T11:58:20.629Z TRACE url.https://github.com.insteadof=ssh://git#github.com
2019-12-21T11:58:20.630Z TRACE ---> Using 'yarn install' with YARN_ARGS
2019-12-21T11:58:21.356Z TRACE yarn install v1.10.1
2019-12-21T11:58:21.594Z TRACE warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
2019-12-21T11:58:21.657Z TRACE [1/4] Resolving packages...
2019-12-21T11:58:23.111Z TRACE [2/4] Fetching packages...
2019-12-21T11:58:53.081Z TRACE error #typescript-eslint/eslint-plugin#2.10.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "10.12.0"
2019-12-21T11:58:53.083Z TRACE error Found incompatible module
2019-12-21T11:58:53.086Z TRACE info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2019-12-21T11:58:58.441Z TRACE error: build error: non-zero (13) exit code from bucharestgold/centos7-s2i-web-app:10.x
2019-12-21T11:59:00.497Z ERROR build failed with message: Assemble script failed.
2019-12-21T11:59:00.503Z ERROR Assemble script failed.
i am not able to understand what I am missing here. I found that bucharestgold/centos7-s2i-web-app has been depreicated and tried with npx nodeshift --strictSSL=false --dockerImage=nodeshift/ubi8-s2i-web-app --build.env YARN_ENABLED=true --deploy.env NPM_RUN="npx yarn start" --deploy.port=3000 --expose. This is also throwing same error message.
You can use the new web-app flag feature and let nodeshift set the appropriate docker image.
Try running this command instead npx nodeshift --web-app --build.env YARN_ENABLED=true --deploy.env NPM_RUN="npx yarn start" --deploy.port=3000

Error Deploying ASP.NET Core Web Application + ReactJS to Azure

Trying to deploy an ASP.NET Core Web Application + ReactJS to Azure and the Publish step in my pipeline always ends in error – “Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1”
My pipeline is composed of:
Prepare job
Initialize job
Checkout
Restore
npm install (step added by me after some errors)
npm audit fix (step added by me after some errors)
npm run build (step added by me after some errors)
Build
Test
Publish <- Error!
Publish Artifact
Post-job: Checkout
Finalize Job
The error I get in the Pusblish step is:‌
===
Webpack compilation mode: production ===‌
(…)
Hash: c2e1b3f9437a24e5157e
Time: 108142ms
Built at: 05/09/2019 1:13:13 PM
Asset Size
Chunks Chunk Names
main-server.js 3.58 MiB
0 [emitted] main-server
Entrypoint main-server = main-server.js
C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):
error MSB3030: Could not copy the file
"D:\a\1\s\wwwroot\dist\main-client.js.map" because it was not found.
[D:\a\1\s\nextvision.csproj]
C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):
error MSB3030: Could not copy the file
"D:\a\1\s\wwwroot\dist\vendor.css.map" because it was not found.
[D:\a\1\s\nextvision.csproj]
C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):
error MSB3030: Could not copy the file
"D:\a\1\s\wwwroot\dist\vendor.js.map" because it was not found.
[D:\a\1\s\nextvision.csproj]
##[error]Error:
The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
##[error]Dotnet
command failed with non-zero exit code on the following projects :
D:\a\1\s\nextvision.csproj
##[section]Finishing:
Publish
Using “npm run build:prod” I thought the *.map files were not even necessary, but that is the only error I see on the Publish step.
Any help would be appreciated.
Thanks,
Pedro Cabral
Remove npm publish step and try again. The npm publish step might be failing because the private property in package.json is set to true.
Try the Publish artifacts step and give the generated artifacts path ( drop or build folder) to the publish path step.

Polymer starter kit gulp error

after downloading and extracting psk1.2.1 and running npm install and bower install, when i run gulp i get the following output
MacBook-Pro-van-Marco:testb mspro$ gulp
[21:18:46] Using gulpfile ~/www/studies/polymer/testb/gulpfile.js
[21:18:46] Starting 'clean'...
[21:18:46] Finished 'clean' after 5.66 ms
[21:18:46] Starting 'default'...
[21:18:46] Starting 'copy'...
[21:18:46] Starting 'styles'...
[21:18:47] styles all files 98 B
[21:18:47] Finished 'styles' after 559 ms
[21:18:48] copy all files 12.75 MB
[21:18:48] Finished 'copy' after 1.72 s
[21:18:48] Starting 'elements'...
[21:18:48] Finished 'elements' after 3.49 ms
[21:18:48] Starting 'lint'...
[21:18:49] Starting 'images'...
[21:18:49] Starting 'fonts'...
[21:18:49] Starting 'html'...
[21:18:49] Finished 'fonts' after 142 ms
[21:18:51] Finished 'lint' after 2.41 s
[21:18:51] html all files 52.36 kB
[21:18:51] Finished 'html' after 1.35 s
[21:18:51] gulp-imagemin: Minified 6 images (saved 494 B - 1.4%)
[21:18:51] images all files 35.41 kB
[21:18:51] Finished 'images' after 1.64 s
[21:18:51] Starting 'vulcanize'...
ERROR finding /Users/mspro/www/studies/polymer/testb/dist/bower_components/paper-behaviors/paper-button-behavior.html
ERROR finding /Users/mspro/www/studies/polymer/testb/dist/bower_components/paper-behaviors/paper-inky-focus-behavior.html
the paper-behaviors folder was empty (except for the README.md)
i then copied the content of the bower_components/paper-behaviors folder of the psk-light download and the error was gone, but starting the demo with gulp resulted in an empty page
looking at the console in chrome i get following errors:
Uncaught TypeError: Polymer.IronMeta is not a function
/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
iron-icon.html:168 Uncaught TypeError: this._meta.byKey is not a function
page.js:797 Uncaught TypeError: Cannot read property 'length' of undefined
here's where i give up for now,
my node version is v4.2.4 on mac osx 10.10.5
Chrome 47.0.2526.106 (64-bit)
does anyone have a idea how to solve this problem?
thanks
It would be helpful to include the actual commands you ran and which version of the PSK you tried. Here are the steps I followed and was able to get the PSK installed and run gulp and gulp serve without error.
Download Polymer Starter Kit
Under Intermediate - Advanced Users click on polymer-starter-kit-1.2.1.zip
Extract ZIP file to preferred location
Install Node.js if needed before running the next step
With Node.js installed, run the following one liner from the root of your Polymer Starter Kit download:
npm install -g gulp bower && npm install && bower install
OR if admin permission is needed:
sudo npm install -g gulp bower && npm install && bower install
NOTE: This step takes a few minutes to install all of the dependencies.
Then start the web server using this one liner from the root of your Polymer Starter Kit download:
gulp serve

Resources