Psci Uncaught ReferenceError: require is not defined when using port - purescript

I'm running psci with port for example
pulp psci -- -p9000
and it borks with
Uncaught ReferenceError: require is not defined
at PSCI.Data.BigInt (bundle.js:52952)
at bundle.js:53042
Found this require here
.psci_modules/node_modules/Data.BigInt/foreign.js
I could not find some docs explaining this, am I doing this right?

The problem is that Data.BigInt depends on the big-integer NPM package, which is not available in the browser when running with --port.
To make this work, you would need some way to provide a dummy require function in the browser.

Related

Migrating Existing, Strapi App from Using Sqlite3 to Using MongoDB

I have a local, strapi app (that I have in a git repo) that I want to migrate from using sqlite3 to using mongodb
I have done the following:
created a 2nd, temporary, strapi app that is successfully using mongodb from the start (so I have a good mongo instance running locally)
copied the database.json content from the temp, working-mongodb, strapi app to my existing one. (made sure was in development and ran development version)
From my existing app (from which I want to use mongodb), I
uninstalled:
strapi-hook-bookshelf
strapi-hook-knex
knex
sqlite3
installed strapi-hook-mongoose
NOTES:
the existing app (from which i want to use mongodb) runs successfully if I keep just keep using sqlite3.
i created the existing app using the quickstart option
But, I still get this error...terminal output, snippet below 👇
Terminal Output Snippet:
(node:37499) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(node:37499) UnhandledPromiseRejectionWarning: TypeError: orm.load(...).buildQuery is not a function
at buildQuery (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-utils/lib/buildQuery.js:122:21)
at Object.count (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/config/queries/mongoose.js:18:12)
at Object.initialize (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/services/UsersPermissions.js:502:8)
at module.exports (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/config/functions/bootstrap.js:156:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:37499) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:37499) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[2019-07-03T18:27:15.985Z] warn The bootstrap function is taking unusually long to execute (3500 miliseconds).
[2019-07-03T18:27:15.986Z] warn Make sure you call it?
What am I doing wrong? 🤔
This is cool! I can answer my own question! 😜
Seriously though, I am answering my own question for the benefit of others that might run into the same issue.
Bottom line: I had the wrong version of strapi-hook-mongoose installed.
Details: When I installed strapi-hook-mongoose, I didn't specify a version, and so, npm installed ^3.0.0-alpha.13, and due to the fact that my existing, strapi project is on the (then) latest v3.0.0-beta.7, it failed to run (gave the error described in the above description).
Solution: Uninstall the package and re-install, explicitly specifying the version 👇
npm i strapi-hook-mongoose#3.0.0-beta.7 🙌

Why does BitBake error if it can't find www.example.com?

BitBake fails for me because it can't find https://www.example.com.
My computer is an x86-64 running native Xubuntu 18.04. Network connection is via DSL. I'm using the latest versions of the OpenEmbedded/Yocto toolchain.
This is the response I get when I run BitBake:
$ bitbake -k core-image-sato
WARNING: Host distribution "ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Fetcher failure for URL: 'https://www.example.com/'. URL https://www.example.com/ doesn't work.
Please ensure your host's network is configured correctly,
or set BB_NO_NETWORK = "1" to disable network access if
all required sources are on local disk.
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
The networking issue, the reason why I can't access www.example.com, is a question for the SuperUser forum. My question here is, why does BitBake rely on the existence of www.example.com? What is it about that website that is so vital to BitBake's operation? Why does BitBake post an Error if it cannot find https://www.example.com?
At this time, I don't wish to set BB_NO_NETWORK = "1". I would rather understand and resolve the root cause of the problem first.
Modifying poky.conf didn't work for me (and from what I read, modifying anything under Poky is a no-no for a long term solution).
Modifying /conf/local.conf was the only solution that worked for me. Simply add one of the two options:
#check connectivity using google
CONNECTIVITY_CHECK_URIS = "https://www.google.com/"
#skip connectivity checks
CONNECTIVITY_CHECK_URIS = ""
This solution was originally found here.
For me, this appears to be a problem with my ISP (CenturyLink) not correctly resolving www.example.com. If I try to navigate to https://www.example.com in the browser address bar I just get taken to the ISP's "this is not a valid address" page.
Technically speaking, this isn't supposed to happen, but for whatever reason it does. I was able to work around this temporarily by modifying the CONNECTIVITY_CHECK_URIS in poky/meta-poky/conf/distro/poky.conf to something that actually resolves:
# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
# fetch from the network (and warn you if not). To disable the test set
# the variable to be empty.
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master
CONNECTIVITY_CHECK_URIS ?= "https://www.google.com/"
See this commit for more insight and discussion on the addition of the www.example.com check. Not sure what the best long-term fix is, but the change above allowed me to build successfully.
If you want to resolve this issue without modifying poky.conf or local.conf or any of the files for that matter, just do:
$touch conf/sanity.conf
It is clearly written in meta/conf/sanity.conf that:
Expert users can confirm their sanity with "touch conf/sanity.conf"
If you don't want to execute this command on every session or build, you can comment out the line INHERIT += "sanity" from meta/conf/sanity.conf, so the file looks something like this:
Had same issue with Bell ISP when accessing example.com gave DNS error.
Solved by switching ISP's DNS IP to Google's DNS (to avoid making changes to configs):
https://developers.google.com/speed/public-dns/docs/using

numba caching issue: cannot cache function / no locator available for file

I am trying to deploy a codebase that has a number numba.njit functions with cache=True.
It works fine running locally (Mac OS X 10.12.3), but on the remote machine (Ubuntu 14.04 on AWS) I am getting the following error:
RuntimeError at /portal/
cannot cache function 'filter_selection':
no locator available for file:
'/srv/run/miniconda/envs/mbenv/lib/python2.7/site-packages/mproj/core_calcs/filter.py'
I looked through the numba codebase, and I saw this file: https://github.com/numba/numba/blob/master/numba/caching.py
It appears that the following function is returning None instead of a locator, for this exception to be raised
cls.from_function(py_func, source_path)
Guessing this is a permission to write the pycache folders, but I didn't see in the numba docs a way to specify the cache folder location (CACHE_DIR).
Has anyone hit this before, and if so, what is the suggested work-around?
Set sys.frozen = True before for cls in self._locator_classes: in caching.py can eliminate the issue.
I have no idea whether such setting will impact performance.

A WebGroup/Virtual Host to handle /appname has not been defined

I get the following error message when I try to open up my application from the web (using 'appname' as my application name, the root name of my application - the error displays my app's actual name):
com.ibm.ws.webcontainer.internal.WebContainer handleRequest SRVE0255E: A WebGroup/Virtual Host to handle /appname has not been defined.
As far as I can tell, my application was installed correctly and is running on our Websphere server (WAS 8.5).
I'm at a loss for what to pursue in order to resolve this issue - what possible issue could my application be having?
Map your web module to /appname in the administration console, or use whatever context-root is specified for the web module.

Exception: cannot run map reduce without the js engine

I'm trying to run a map/reduce query on a MongoDB collection and I'm getting the following error:
uncaught exception: map reduce failed:{
"errmsg" : "exception: cannot run map reduce without the js engine",
"code" : 16149,
"ok" : 0
}
I can't seem to turn anything up on google for it. I've tried searching for the exception message but no one has written about it would seem. I suspected it might be a privilege issue to start with, but can't find a related privilege.
I didn't set the instance up, so is there some sort of configuration option that could have disabled the js engine, or perhaps a memory limit or something?
We have same issue in our system.
MongoDB has its own JS engine V8 configured by default but in our SIT / UAT environments our DBA has disabled JS Engine V8 to run javascript code since it generates security issues.
After this change our application started generating all these issues regarding to map reduce, but after enabling usev8 flag back again this issue was solved.
If you want to compile mongo sources you can do:
scons --release --usev8
Hope to help.