Appcelerator Titanium module TiJSPDF - titanium

I would like to use this module on my Titanium project : https://github.com/AppWerft/TiJSPDF
To install, I have just copied the folder 'modules' in my project and I have added it in tiapp.xml.
When I try to use it :
require('ti.jspdf');
var doc = new jsPDF();
I get the following error :
- Message: Uncaught ReferenceError: jsPDF is not defined
I think I don't use this module correctly. Can you help me, please ?

Since this is a javascript module and not a compiled module, put it in the app/lib folder of your alloy project. See the documentation on Javascript modules here: http://docs.appcelerator.com/platform/latest/#!/guide/CommonJS_Modules_in_Titanium-section-src-29004791_CommonJSModulesinTitanium-JavaScriptModules

Related

Sveltekit with Superbase __api not defined

I have successfully run superbase with svelte using this tutorial . However I really need the sveltkit rather than basing it on the svelte template . When I try to use superbase based on a sveltkit project I get the following error
11:50:01 [vite] Error when evaluating SSR module /src/superbaseClient.js:
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
11:50:01 [vite] Error when evaluating SSR module /src/routes/sbase.svelte:
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
__api is not defined
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
I have tried
Created a new sveltkit project using the sveltkit getting started instructions
Followed the getting started instructions in superbase but replaced the use of the svelte template with a sveltekit project.
Installed superbase with https://github.com/supabase-community/svelte-supabase
I ignored the lines about installing the rollup plugins in the guide because I believe they are covered off by svelte kit.
More code is available for the whole project on the github. The code with all my failed attempts at getting it to work can be found in a branch on that repo called "add superbase"
You can try the Supabase Adder: https://github.com/supabase-community/svelte-supabase

Unable to resolve module `url` from [path]/node_modules/ws/lib/WebSocket.js

I created a new React Native v 0.42.0 project with the following libraries installed.
react-native-ble: 1.0.8
bleat: 0.1.1
In addition to the welcome page. I added the two following lines to load the bleat and noble and an remote android tablet.
var noble = ('noble');
var bleat = require('bleat').classic;
Noble loads correctly, but everytime I try to include the bleat library I get this error.
==============================================
The development server returned error code: 500
URL: http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
Unable to resolve module url from [path]/node_modules/ws/lib/WebSocket.js
Module does not exist in the module map or in these directories
/node_modules/
===============================
I'm not quite sure how to fix this issue.
I found my answer to this issue to be inserting this line into my package.js file.
"browser": {
"noble": "react-native-ble"
}

Not able to show image (API setDrawIcons() not found error)

I am using MPAndroidChart in our android project to show graph and it's very helpful. Using latest version 3.0.1 (https://github.com/PhilJay/MPAndroidChart#usage)
I have some requirement to show image on top of BarEntry after some condition met. Same is working in example code downloaded.
BarDataSet set1;
set1.setDrawIcons(true);// Cannot resolve method 'setDrawIcons(boolen)
Why the above API is not part of library MPChartLib, am I missing something here?
Above problem got solved after integrating MPChartLib source code.
File -> Project Structure
click plus button to add New Module
Import Gradle Project
from Source directory: and finish.
The setDrawIcons method was added in 3.0.2. Change your Gradle option to read compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'

"Unable to resolve module path" in React Native

After adding a new dependency, I get the error message "Unable to resolve module path" in a red screen in my React Native app. I've tried clearing the cache as the screen instructs.
(question is brief as I'm answering it myself)
The error message:
Unable to resolve module path
Should really be:
Unable to resolve module "path"
path is the name of the module it can't load! I was reading the error message as "can't resolve a path to the module".
So the root cause is, the file it lists in the error message is importing the native Node module path, which isn't available on React Native.
The solution is to npm install -D path, which is a replica implementation.
Any imports from #babel/core package is causing this error.
Some code editors are inserting the import line automatically.
For example, import { types } from '#babel/core' is inserted by Visual Studio Code when you enter types.
If you remove the imports from #babel/core in the codes, it will be fixed.
Quote from chronikum on react-native github issues for future readers
Just check if you somewhere accidentally imported something from
#babel/core.
Here is the original link
https://github.com/facebook/react-native/issues/27522#issuecomment-568306279
None of the answers are really helpful, I found that the problem in my case was that the macros plugin was missing in my babel configuration file.
This is what I had in my babel.config.js
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
};
After adding the macros plugin
module.exports = {
plugins: ["macros"],
presets: ["module:metro-react-native-babel-preset"],
};
If you get this error, most like you are missing a plugin in your babel config.
I have solved my issue by the below steps.
Read the error message carefully, the error is node modules path(mentioned as NO: 1 in below image). In my case, I have the "just-cli/" module (Mentioned NO: 2).
search the module (just-cli) you have imported somewhere in your project and just Remove it. The problem will be solved.

Prestashop 1.6.1.4 - Undefined constant for custom module

We have upgraded from Prestashop 1.6.0.9 to 1.6.1.4. After updating to new version one of our custom module started throwing Fatal Error like :
PHP ERROR
We have defined this constant in the classes/pdf/PDF.php file.
I am not able to trace the error as it was working previously. Any help or reference will be appreciated.
Try to define this constant in your custom module like that:
if (!defined('TEMPLATE_PRODUCT_RETURN'))
{
define('TEMPLATE_PRODUCT_RETURN', '...');
}