I was following the steps in https://single-spa.js.org/docs/create-single-spa to create a single-spa application
? Directory for new project testapp
? Select type to generate single-spa application / parcel
? Which framework do you want to use? angular
? Project name (can use letters, numbers, dash or underscore) testapp
Need to install the following packages:
#angular/cli
Ok to proceed? (y) y
npm WARN deprecated #npmcli/move-file#2.0.1: This functionality has been moved to #npmcli/fs
Node.js version v17.9.0 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/releases/.
? Would you like to share pseudonymous usage data about this project with the Angular Team
at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more
details and how to change this setting, see https://angular.io/analytics. No
Global setting: disabled
Local setting: No local workspace configuration file.
Effective status: disabled
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
And then installing
npm i #angular-builders/custom-webpack
After running
npm run serve:single-spa:testapp
The application was deployed but it just showed a blank screen when accessing http://localhost:4200
Any idea?
Related
I am looking up the sample for the sap.m.UploadCollection control. I've downloaded and run the sample package locally using the following commands:
npm install
and then
ui5 serve -o index.html
I get the following error in console when navigating to http://localhost:8080/index.html:
2022-08-15 16:56:35.802600 Failed to load component for container container - ModuleError: Failed to resolve dependencies of 'sap/m/sample/UploadCollection/Page.controller.js'
-> 'sap/m/MessageToast.js': failed to load 'sap/m/MessageToast.js' from ./resources/sap/m/MessageToast.js: script load error
ModuleError: Failed to resolve dependencies of 'sap/m/sample/UploadCollection/Page.controller.js'
If I move the Page.contoller.js to a newly created controller folder and move the Page.view.xml to the newly created view folder, then a different error occurs.
How can the downloaded sample project run locally?
Make sure that the downloaded project has the UI5 Tooling part is correctly configured according to the documentation https://sap.github.io/ui5-tooling/pages/Configuration
In your case, the control sap.m.UploadCollection is deprecated since UI5 1.88. So download one of the sap.m.upload.UploadSet samples instead. When downloaded, see which settings are missing in the ui5.yaml config file. E.g. run the below UI5 Tooling commands to add the missing settings:
ui5 use openui5#latest
ui5 add sap.ui.core sap.m sap.ui.layout sap.ui.unified themelib_sap_fiori_3 themelib_sap_horizon
This will at least allow the application to start.
Below are the two error (image) I’m facing
I’m using Ionic 4.
everything works but as soon I start calling WooCommerce API and use it in constructor I get the below two errors.
I have imported Woocommerce API, but when I initialize it in constructr it shows both of this error.
It looks like you are using this package which has an obsolete warning:
2019-07-29: This client is obsolete and will no longer receive updates, a new JavaScript library is available under the name of #woocommerce/woocommerce-rest-api.
However, that's a node.js package. It's failing because fs stands for filesystem and that doesn't exist in the browser.
Node.js is for local development, not for browser packages, which is what Ionic 4 is built with.
However, if you really want to use it then this guide will show you how to wrap it up using browserify:
Transforming a Node.js Module to A Browser Library
The solution is to use Browserify to bundle the module with all its dependencies inside one JavaScript file so we will not need any external Node.js dependencies which are not available inside the Cordova webview (a headless browser) used by Ionic 4.
https://www.techiediaries.com/woocommerce-ionic-2/
I don't know how far you'll get as it's for Ionic 2 but I'm just showing you this to demonstrate that node.js packages are not for Ionic.
Update
Based on your comments you say you are having problems with global not being defined.
Searching Google this seems to be a solved issue, try:
I think for now the best option would be to include
(window as any).global = window;
In your polyfills.ts file, as mentioned here:
angular/angular-cli#9827 (comment)
You have to go to folder \node_modules\#angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\browser.js and replace node: false, by node: { crypto: true, stream: true, fs: "empty", net: "empty", tls: "empty" },
It's working for me.
When I was going through the Google Cloud tutorial: https://cloud.google.com/python/getting-started/using-pub-sub#running_the_app_on_your_local_machine
I got the following error:
google.auth._default No project ID could be determined from the Cloud SDK configuration. Consider running gcloud config set project or setting the GOOGLE_CLOUD_PROJECT environment variable
I did 'gcloud config set project [my project name]' with no success.
What's the problem?
Update: I've deployed app engines previously without any problem. The problem only happens when I run the psqworker for this Pub/Sub function. I know my project ID and used it before.
The first thing I would try would be:
gcloud info
This will tell you the account and project that gcloud is currently set to.
You may also find the available projects for your account with the following gcloud command:
gcloud projects list
Locate the project ID and project number
There are two ways to identify your project: the project number and project ID.
The project number is automatically assigned when you create a project.
The project ID is a unique identifier for a project. When you first create a project, you can accept the default generated project ID or create your own. A project ID cannot be changed after the project is created, so if you are creating a new project, be sure to choose an ID that you'll be comfortable using for the lifetime of the project.
Note: You should be aware that some resource identifiers (such as project IDs) might be retained beyond the life of your project. For
this reason, avoid storing sensitive information in resource
identifiers.
To locate your project ID and project number:
Go to the Cloud Platform Console
From the projects list, select the name of your project.
On the left, click Dashboard. The project name and ID are displayed in the Dashboard.
TL;DR
Use virtualenv -p C:/Python27/python.exe name-of-env instead of virtualenv -p C:/Python36/python.exe name-of-env in the tutorial
I ran into a similar issue. Here are the steps I went through and why. Hope it helps!
First I tried to specify the id with the command gcloud config set project name-of-your-project
This resulted in the error
ERROR: Python 3 and later is not compatible with by the Google Cloud SDK. Please use a Python 2.7.x version.
If you have a compatible Python interpreter installed, you can use it by setting
the CLOUDSDK_PYTHON environment variable to point to it.
I thought this error was weird because the tutorial tells you to use python3 but it doesn't work. So I created a virtualenv with python2.7 like so
virtualenv -p C:/Python27/python.exe name-of-env (I have python 2 and 3 so its easier to specify the whole path to the .exe file)
Then follow the rest of the tutorial with
name-of-env\scripts\activate
pip install -r requirements.txt
Don't know why you have to use python3 when it doesn't even work.
I have a landing page (some.html) pointing to bundle.js . Under the chrome debugger I do see all my files getting loaded properly but still I get errors in the code like 'this' is undefined etc .
Please note :
I don't have node / npm / webpack installed
I am not running webpack-dev-server running on this server
What is the proper way to deploy / refer a bundle.js file ?
Do I need to install webpack globally on this server ?
I need to know is it possible to just get the functionality of my SPA through a bundle.js being pointed from index.html provided that bundle.js was generated using a webpack on my dev-machine ?
Seems like yes through an index.html we can point to a bundled js if all the functionality is client side and we can get the desired functionality. My reactApp was broken because it the underlying the page (old application) was supporting prototype.js and therefore react's internal functions had issues. Once I removed reference to prototype - my application is working in that old container –
I wonder if I can automate WPI actions to setup a dev box in unattended mode, either with command line options or a configuration file. It looks like WPI takes a "URL" as a command line parameter but I have no idea what format the response should be in, and what it allows in general.
EDIT: Thanks folks for the huge effort to come up with ways to automate setups. As #fra mentioned now there is a command line tool for WPI.
WebPi Command Line was just released:
http://blogs.iis.net/satishl/archive/2011/01/26/webpi-command-line.aspx
"C:\Program Files\Microsoft\Web Platform Installer\WebPlatformInstaller.exe" /id "wpi://iisexpress&mvc3"
Will install both IIS Express and ASP.Net MVC
(using wpi version 3.0)
**
UPDATE:
**
Take a look at this awesome sauce
http://msdn.microsoft.com/en-us/library/gg433092.aspx
One more option that was not yet mentioned is that you can also directly plug into Web PI APIs. Here are some starting points:
Web PI APIs: Download Latest Web Stack Products for Any Platform
Web PI APIs: Install a product from a custom feed
However in most of the cases, WebPICmdLine should do the job.
I'm currently investigating this, thought I'd record what I've discovered so far.
webplatforminstaller.exe <configuration file> /id <wpi url>
configuration file: xml file defining the products that can be installed. See http://www.microsoft.com/web/webpi/2.0/webproductlist.xml for an example. If this parameter is not specified, the configuration file at that url will be used.
wpi url: wpi url that specifies a product to install. The format is wpi://productid/? where productid is the id of an entry in the xml file.
I'm still trying to figure out how to force the install to happen silently. I'll update if I find out how.
The WebPICmdLine alone does not work as it will ask you to install the web platform installer 3.0 or whatever the dependecy for the product/application you will try to install.
Therefore, install the Web Platform installer first (wpilauncher.exe), then drop webpicmdline.exe to that installation folder. After that, you should be all set to use the command line tools for your installation needs.
I have yet to figure out how to do an unattend to the wpilauncher.exe itself.