Meteor import error - meteor

I would like import a template for sending mail with email package with Meteor APP but I get the error Can not found module email.html. My relative path is correct.
My /imports/startup/server/smtp.js
import { email } from '../../ui/email/email.html';
// sendEmail function
This file, smtp.js, is imported on /server/main.js.
Do you have any idea why I have this error?
Thank you!

if you are importa a html file, try use
import '../../ui/email/email.html';
Like view in oficial tutorial.

Related

Meteor Tabular errors on initialization

I'm following along the guide to setup Meteor Tabular v2.1.2 (guide). I have added the package and installed the theming packages. I'm using Meteor v2.8.0 and the project is a Blaze-based project.
In client/main.js, I set up the library as instructed.
import { $ } from 'meteor/jquery';
import dataTablesBootstrap from 'datatables.net-bs';
import 'datatables.net-bs/css/dataTables.bootstrap.css';
import "../imports/ui/body";
dataTablesBootstrap(window, $);
Now when I go to the browser, there is this error:
Can anyone help me on this?
So after serious debugging , I discovered it is enough to just import the DataTable module as such after installing it with npm
import { $ } from 'meteor/jquery';
import 'datatables.net-bs';
import 'datatables.net-bs/css/dataTables.bootstrap.css';
import "../imports/ui/body";
// You don't need the code previously here .
You can now setup you DataTable as such
$(element).DataTable(//Your config object)

Can I have any way to import module about aws-export.js?

Now I'm trying to import aws-exports.js which amplify-js automatically generates in node es6 type code.
my code like this. ex:something.mjs
#!/usr/bin/env node
import awsmobile from '../src/aws-exports.js';
something ....
and I try to execute under bellow
# ./something.mjs
export default awsmobile;
^^^^^^
SyntaxError: Unexpected token 'export'
then, the above error will be output.
I wonder, the aws-exports.js generated by amplify-js is in es6 format, but the extension is js.
Is this the only way to execute it by writing "module" as the "type" field of package.json?
Changing file to .ts worked for me.
deleting the aws-exports.js file and then running "amplify configure project" worked for me

The basic installation of firebase package in WIX project doesn't work

I installed firebase v-5.8.2 package through WIX's package manager. The installation process doesn't have any problem per se. After installation, I added "import * as firebase from 'firebase/app'", without any other code. When I run the project, it gave error message "can not find module 'fs'"
In the wix's forum, seems that someone had success experience with an earlier firebase version. Wondering if the v-5.8.2 has some problem with WIX.
import * as firebase from 'firebase/app'
"can not find module 'fs'"
You are importing it on a backend .jsw file, right?
NPM modules can only be imported on backend files and not on your page code.
You can export the functions from a backend file like below:
//serverSide.jsw
import firebase from 'firebase';
var app = require('firebase');
export function backendModule() {
//Your backend function code here
}
Then import the function on the frontend page code like below:
import {backendModule} from 'backend/serverSide.jsw';
$w.onReady(function () {
//TODO: write your page related code here...
});
If you are already importing on the backend file then try this below
import firebase from 'firebase';

Unable to import sumCashBy using IntelliJ IDEA

IntelliJ IDEA started highlighting errors in some of my import statements that worked previously. This is not unexpected as net.corda.finance is still in the "incubating" stage.
I am working in Java.
Corda Release: 3.3
Noticed this change on github: https://github.com/corda/corda/pull/4700
So I made what I thought are the necessary changes...
//Old
//import static net.corda.finance.utils.StateSumming.sumCashBy;
//New
import static net.corda.finance.contracts.utils.StateSumming.sumCashBy;
...but I'm still getting an error. I am sure I must be overlooking something simple.
#Kid101 put me on the right track by trying StateSumming.sumCashBy(contractState)
Once I did that IntelliJ recognized I needed to add:
net.corda:corda-finance:3.3-corda
...to the classpath. If I allowed IntelliJ to add it from the context menu the error reappeared every time gradle refreshed. So I added:
cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
...to the build.gradle file under the dependencies section. No more errors with my import statement:
import net.corda.finance.utils.StateSumming;
...and no issues calling the sumCashBy method.
The change you mention is in Corda master branch, In CashTests.kt you can see how sumCashBy is imported, import net.corda.finance.contracts.utils.sumCashBy.
In corda/release-V4-branchpoint import is still net.corda.finance.utils.sumCashBy i.e. the change has not made in yet to V4.
Try to build the project again.
If using Java, try: StateSumming.sumCashBy(contractState)
You should import a dependency package.
You add below to build.gradle and refresh your IntelliJ project.
dependencies {
....
cordaCompile "$corda_core_release_group:corda-finance-contracts:$corda_core_release_version"
...

QtAV in QT in QML

i am using QtAV but getting this error so please help me:
QQmlApplicationEngine failed to load component
qrc:/main.qml:4 plugin cannot be loaded for module "QtAV": Cannot load library /home/intel/Qt5.7.0/5.7/gcc_64/qml/QtAV/libQmlAV.so: (libswresample.so.2: cannot open shared object file: No such file or directory)
at qrc:/main.qml:4 import QtAV1.6
using linux
The application cannot find your requested plugin.
You need to check if your import path is set correctly. If this is the case: please check if the plugin is installed correctly. You can use
export QML_IMPORT_TRACE=1
to check which import pathes are set.
And make sure, that all dependncies are installed as well. For instance libswresample ( see https://ffmpeg.org/libswresample.html )

Resources