Running the dummy app in an Ember addon project can't find app/styles/app.less - ember.js

I'm trying to test an Ember addon project by running ember server inside an addon project. This runs the dummy app. However I am not getting my less files automatically being build with the ember-cli-less functionality (expecting /app/styles/app.less):
Some files I have:
/addon-project
/app
/styles
/less
app.less
/dist
/assets
dummy.js
dummy.css
/tests
/dummy
However I am getting an error when I run ember server:
version: 0.1.15
Could not find watchman, falling back to NodeWatcher for file system events
Livereload server on port 35730
Serving on http://0.0.0.0:4201/
File not found: /app/styles/app.less
in any of the following include paths:
/Users/me/github/ember-addons/header/tmp/tree_merger-tmp_dest_dir-qEC1hODR.tmp
Error: File not found: /app/styles/app.less

You should try moving the "app.less" file up one level (out of your less folder so that it is in the "styles" folder).

Related

Azure web app intermittently copying code from tmp to home

I am deploying a Django appication to a Azure Web App via Github Actions. The code is consistently deployed to the tmp folder but is not always copied to wwwroot, even though Oryx deployment logs state that the contents are copied. What causes this intermittent behaviour?
Detecting platforms...
Detected following platforms:
python: 3.8.12
Using intermediate directory '/tmp/8da59cae1f18fde'.
Copying files to the intermediate directory...
Done in 0 sec(s).
Source directory : /tmp/8da59cae1f18fde
Destination directory: /home/site/wwwroot
Python Version: /opt/python/3.8.12/bin/python3.8
Creating directory for command manifest file if it doesnot exist
Removing existing manifest file
Python Virtual Environment: antenv
Creating virtual environment...
Activating virtual environment...
Running pip install...
Content in source directory is a Django app
Running collectstatic...
Done in 18 sec(s).
Not a vso image, so not writing build commands
Preparing output...
Copying files to destination directory '/tmp/_preCompressedDestinationDir'...
Done in 31 sec(s).
Compressing content of directory '/tmp/_preCompressedDestinationDir'...
Copied the compressed output to '/home/site/wwwroot'
Removing existing manifest file
Creating a manifest file...
Manifest file created.
Done in 244 sec(s).
For others that may be struggling with this same issue, specifically with Django applications, I have landed on the following workaround:
After learning more about how Oryx build actually works, I now understand that the code IS copied to wwwroot - but as a tarball. The code is then extracted to tmp and executed in this folder. This causes a challenge running django migrations as the migration folder is not persistent at the location where the code is run from, i.e. you are not able to run migrations automatically from the tmp folder (because, assuming you are not putting your migrations in source control, there is no migration history here.) and you are not able to run migrations from wwwroot (because the new code only exists in the tarball). So, in order to persist migration history you will need to:
Extract output.tar.gz in its entirety to wwwroot and overwrite existing files.
OR
Do 1. ONCE in order to get your project structure ready to perform migrations in wwwroot, and after this copy only the files needed to detect database changes (in my case settings.py, forms.py, models.py and admin.py) from tmp to wwwroot. This can be done automatically by editing the startup command.

Nativescript vue webpack configaration missing

I;m beginner to nativescript-vue. When i initiate my project with following command tns run android it will occur below error
The webpack configuration file /home/camilus/laravel/vue-native/drawer/webpack.config.js does not exist. Ensure you have such file or set correct path in nsconfig.json
So could you please solve this issue.

ImportError: no module named [directory] Google App Engine

I keep getting an error that says no module named backend, this is the directory where my webapp2 application is.
My folder structure:
/project
/backend
/env #python virtual env libraries
main.py #my main entry point where webapp2 app instance is
requirements.txt
app.yaml
My app.yaml:
service: default
handlers:
- url: /dist
static_dir: dist
- url: /.*
script: backend.main.app
libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest
Before my app.yaml was in backend, but I decided to move to root. Now when I run dev_appserver.py in root, I keep getting ImportError: No module named backend
I created the virualenv and installed the requirements.txt packages inside the backend directory.
EDIT: I am unsure if this makes a difference, but I have already deployed my application when the app.yaml was inside the backend folder. I am guessing this should not matter since I am trying to test locally by moving the app.yaml in my project root and running dev_appserver.py app.yaml, but it seems to not work when I do this.
The directory containing the app.yaml file for a GAE service is the service's top-level directory. The content of this directory is what will be uploaded to GAE when you deploy the service. All paths referenced in the service's code or configurations are relative to this top level dir. So moving the app.yaml file around without updating the related code and configurations accordingly will break the app's functionality.
You don't seem to grasp the meaning of the script: statement very well. From Handlers element:
A script: directive must be a python import path, for example,
package.module.app that points to a WSGI application. The last
component of a script: directive using a Python module path is the
name of a global variable in the module: that variable must be a WSGI
app, and is usually called app by convention.
Note: just like for a Python import statement, each subdirectory that
is a package must contain a file named __init__.py
So, assuming your app.yaml file is located in your project dir, the
script: backend.pythonAttack.app
would mean:
having an __init__.py file inside the backend dir, to make backend a package
having a pythonAttack.py file in the backend dir, with an app variable pointing to your webapp2 application
According to your description you don't meet any of these conditions.
My recommendation:
keep the app.yaml inside the backend dir (which doesn't need to be a python package dir)
update its script line to match your code. Assuming the app variable for your webapp2 app is actually in the main.py file the line would be:
script: main.app
run the app locally by explicitly passing the app.yaml file as argument (in general a good habit and also the only way to run apps with multiple services and/or a dispatch.yaml file):
dev_appserver.py backend/app.yaml
store your service python dependencies inside a backend/lib directory (to follow the naming convention), separated from your virtualenv packages
store the env virtualenv package dir outside the backend directory to prevent unnecessarily uploading them to GAE when deploying the service (and potential interference with the app's operation). The goal of the virtualenv is to properly emulate the GAE sandbox locally so that you can run the development server correctly.
Potentially of interest for structuring a multi-service app: Can a default service/module in a Google App Engine app be a sibling of a non-default one in terms of folder structure?

Hosting Ember-CLI app on Parse.com

This is a follow-up question to Ember.js app, Parse throws 404 for any path but root:
I have built an Ember-CLI app that I now want to host on Parse.com.
I can't figure out how to actually run the app server on Parse. I confess I don't understand how to serve an Ember-CLI in production from any server.
Do I run "ember server" on Parse somehow or do I need to make my own Express server for this to work?
Run parse new in some temp folder to create the correct config files for your existing parse app
Edit .ember-cli file and add "output-path" : "dist/public" to deploy your code to dist/public
Copy the folders code and config from your temp folder in step 1 to dist/code and dist/config
In a terminal window cd dist and parse deploy
Edit environment.js in your ember config folder and change locationType to hash

Run Django project using wsgi

Hi i am trying to host the django site using WSGI app.My project resides in /opt/labs and the contents of this are django/ labs_site/ content/ home/
labs_site was the initial project that was derived from startproject and from labs_site/urls.py i link to content,home and other modules
i have followed the documentation in https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/ till renaming labs_site/wsgi.py as os.environ.setdefault("DJANGO_SETTINGS_MODULE", "labs_site.settings")
So after this what is the next step that i should follow.I want to run the project without the runserver
modify your apache settings now. If setting up wsgi file was your first step, then next step should be modifying your apachee config to point towards that file.
The link you posted points towards this page: https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/
that has all the necessary information. You can just choose between putting all that into http.conf file or creating site file for it under sites-available & sites-enabled folders in /etc/apache.
After that - restart your apache server by /etc/init.d/apache2 or service apache2 restart - whichever works.
Then since its your first time, youll see some errors in your /var/log/apache2/error.log. Fix them... and try again :)
Good luck.