Importing chart.js to aurelia causes page errors after bunldling - chart.js

In a project using the aurelia framework I installed chart.js v2.0 beta using:
jspm install npm:chart.js
I import the library by using:
import Chart from 'chart.js';
When application is unbundled I get no errors. If I bundle the application the page loads and displays the graph, but I get 78 errors of missing javascript files like this:
GET http://localhost:9000/core/core.js 404 (Not Found) # system.src.js:4597
As far as I can think it searches for these files (which are part of the chart.js library), in the base directory (which is localhost:9000 as I run gulp watch).
Does anyone know what I am doing wrong?

most likely you need to install chart.js with a "global" override:
jspm install npm:chartjs -o "{format: 'global'}"
But, actually, your best option is to use aurelia-chart, which is based on chart.js 2.x :)

Related

VS Code + Pylance does not find venv-installed modules while venv is activated

I use VS Code Version: 1.74.3 on MacOS 13.2. python -V returns Python 3.11.1.
I get the following error message: Import "django.shortcuts" could not be resolved from source Pylance(reportMissingModuleScource).
As you can see in the screenshot, the correct venv is activated and includes Django.
I also tried or checked:
Import could not be resolved/could not be resolved from source Pylance in VS Code using Python 3.9.2 on Windows 10
https://stackoverflow.com/a/65802367/2321643 but
the suggested solution with reloading the windows did not help.
reinstallation the virtual environment within VSCode and installing Django again
re-selecting the venv.
deleting all python-specific settings in user/settings.json as well as .vcode/settings.json.
Reinstallation python and associated extensions.
Using Debug I can safely run my Django-application without any import issues. What do I need to do that Pylance does not issues these problems?
My issue was a bug, fixed and closed.
For reference: https://github.com/microsoft/pylance-release/issues/3881
Try clicking on where it says "3.11.1 ('.venv': venv)" (near the bottom right).
It should bring up a little dialog sort of thing at the top where you can verify that the Python path is correct.
Check that it is using the correct Python path. It should be something like venv/bin/python3 or venv/bin/python assuming venv is situated at the root of youur project.

Chart.js zoom plugin: Unexpected identifier error in console

I am trying to test chart.js zoom plugin example (from official examples folder) locally. Example file name is zoom.html
I changed scripts paths to local paths in the example code:
<script src="Chart.bundle.js"></script>
<script src="hammer.min.js"></script>
<script src="chartjs-plugin-zoom.js"></script>
All scripts are latest versions:
Chart.js: 2.7.3
Hammer.js: 2.0.8
chartjs-plugin-zoom: does not have version number, but latest downloaded from github
The zoom does not work and I see the error in console:
Uncaught SyntaxError: Unexpected identifier
in line 3 of chartjs-plugin-zoom.js
so it seems like
import Chart from 'chart.js';
line in the plugin code works wrong. Or maybe I am doing wrong something.
The same error happened when I tried other locations of the libraries.
You can run the examples by doing:
git clone https://github.com/chartjs/chartjs-plugin-zoom.git
cd chartjs-plugin-zoom
npm install
gulp build

Django debug toolbar - java error cannot find djdt [duplicate]

Clicking on Hide on the Django debug toolbar (version 1.10.1) does not work on my Google Chrome (Version 69.0.3497.100). I'm using Django 1.11.15 and I can confirm that the Hide does indeed work on Firefox.
The following is output by the console:
Uncaught ReferenceError: djdt is not defined at toolbar.js:305
Line 305 being:
})(djdt.jQuery, djdt);
Anyone have suggestions on how to fix this or provide a possible workaround?
The toolbar.js file does not contain })(djdt.jQuery, djdt); in version 1.10.1. It sounds like your browser may have cached an old version of toolbar.js.
You may have to run collectstatic To update your static files with the new version.

Django Debug Toolbar Won't Hide on Chrome

Clicking on Hide on the Django debug toolbar (version 1.10.1) does not work on my Google Chrome (Version 69.0.3497.100). I'm using Django 1.11.15 and I can confirm that the Hide does indeed work on Firefox.
The following is output by the console:
Uncaught ReferenceError: djdt is not defined at toolbar.js:305
Line 305 being:
})(djdt.jQuery, djdt);
Anyone have suggestions on how to fix this or provide a possible workaround?
The toolbar.js file does not contain })(djdt.jQuery, djdt); in version 1.10.1. It sounds like your browser may have cached an old version of toolbar.js.
You may have to run collectstatic To update your static files with the new version.

Error in generating signed apk

I am getting an error while trying to generate a signed apk for my ionic application. I followed the steps from https://developer.android.com/studio/publish/app-signing.html.
Below is the error image:
Can someone tell the root cause behind this error.
I had this issue literally yesterday. I believe there has been an update to Google Messaging Service (GMS). Are you using the plugin Background Geolocation cordova-background-geolocation OR PushWoosh plugin (pushwoosh-cordova-plugin)?
I have not received a permanent fix (I believe the guys in charge need to update their plugin), but a temporary fix is to navigate to {projectname}-build.gradle.
You should see a line along the following lines:
dependencies {
compile 'com.google.android.gms:play-services-location:11.+'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile(name:'tslocationmanager', ext:'aar')
// logback-android
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'com.github.tony19:logback-android-core:1.1.1-6'
compile('com.github.tony19:logback-android-classic:1.1.1-6') {
exclude group: 'com.google.android', module: 'android'
}
}
Change the top line so instead of 11+, it becomes 11.2.0.
If not, comment which plugins you are using please.
Alternatively
I found a new plugin today which can be used precisely for this, cordova-google-api-version: https://www.npmjs.com/package/cordova-google-api-version.
You can install it by running the following:
cordova plugin add cordova-google-api-version#latest --save