I have a node js library that is compiled with Babel, has mocha tests that run fine. Now I have another app, react redux... that is using the library, included as a dependency in package.json, works fine no problem, BUT when I try to run its own tests (with mocha './test/**/*.spec.js' --compilers js:babel-register) gives an compilation error: TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined
at a line of included compiled lib where is some code from Buffer module used by Babel:
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
and global is the undefined var.
was caused by the bunyan logger used by the included lib, that included some Buffer module and there global was replaced => undefined –
Related
I'm creating a grammar to run a console application, using VSCode or IntelliJ extensions everything seems fine with my .g4 grammar file. But when I execute the command to get the antlr/parser folder:
antlr4 -Dlanguage=Go -o parser items.g4
I get the following errors from the items_lexer.go and items_parser.go files:
Unresolved reference 'DeserializeFromUInt16'
Unresolved reference 'DecisionToState'
Unresolved reference 'DecisionToState'
The first one appears in the following line:
var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn)
Which uses the var: lexerDeserializer declared in the previous line:
var lexerDeserializer = antlr.NewATNDeserializer(nil)
And here is the origin of the problem, directly from antlr lib for some reason the DeserializeFromUInt16 func is not founded. I already tried using another grammar. Im using ANTRL 4.7.2, and I made sure to had a jdk installed, the go get github.com/antlr/antlr4/runtime/Go/antlr, and the .jar folder in my project.
I would appreciate any kind of suggestions about how can I free my files from errors.
Compiling with Angular sources in Ivy partial compilation mode.(node:28784) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\src\spaexample\axcess-spa-mainapp\node_modules\tslib\package.json. Update this package.json to use a subpath pattern like "./*".
✔ Compiling with Angular sources in Ivy partial compilation mode.
✖ Bundling to FESM2015
Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.
Check this answer :
Build error while doing lazy loading of modules
You need to export the lazy loaded modules in the public-api.ts.
I’m upgrading my project to {N} 6.0 and had been using the nativescript-dev-sass plug-in. I realize the .scss files are now handled by WebPack, but I have a partial file (i.e., begins with an underscore since it’s #imported by other, platform-specific files), but I’m getting a build error stating that the variables referenced in the file are not defined, which suggests the file is being processed by the scss transpiler as a stand-alone file.
WARNING in ./views/_app-config-page.common.scss
Module build failed (from ../node_modules/sass-loader/lib/loader.js):
font-size: $apphdr-font-size;
^
Undefined variable: "$apphdr-font-size".
in /Users/david/Documents/NativeScriptProjects/cflclt/app/views/_app-config-page.common.scss (line 36, column 14)
# \b_[\w-]*\.)scss)$ (. sync (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$) ./views/_app-config-page.common.scss
# ./app.js
Is there something extra or different I need to do for partial .scss files in {N} 6.0?
The file name was the problem, or at least the cause of the error. When I changed the file name from
_app-config-page.common.scss
to
_app-config-page-common.scss
the build error went away. It appears this is a difference between WebPack's sass-loader and the previously used, now deprecated, nativescript-dev-sass plug-in.
I'm currently trying to integrate clojure into gradle springboot project, even though it works, I do have to use RT.loadClassForName("au.edu.uq.core"); before the Clojure.var could access the function, if I comment the RT.loadClassForName("au.edu.uq.core");, there will be an error like:
Exception in thread "main" java.lang.IllegalStateException: Attempting to call unbound fn: #'au.edu.uq.core/hello-from-clojure.
But in the build.gradle I already include classes.dependsOn compileClojure.
There are screenshots of build.gradle, Main Java Class and the clojure namespace. This is a tiny demo project for me to learn gradle, any suggestions to make this build process more elegant?
Starting script is ./gradlew bootRun and ./gradlew run
//This is the Java Main Class
//This is the clojure namespace
//This is the build.gradle
From what I got from the screenshot of the Main class, it seems you are using Clojure.lang.RT to load your function, while the official reference documentation suggests otherwise:
Functions in clojure.core are automatically loaded. Other namespaces
can be loaded via require:
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("clojure.set"));
My suggestion would be to try something like:
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("au.edu.uq.core"));
IFn helloFunction = Clojure.var("au.edu.uq.core", "hello-from-clojure");
helloFunction.invoke();
I am building a simple NativeScript app, and am trying to do it using a TypeScript base code.
I am using Sublime Text 3 under OSX.
I realized by looking at the demo apps that the tns_modules matches the NativeScript repository so I added it to my app/ folder as a Git submodule, and then compiled it (npm i && grunt). Is that the wrong way to integrate these modules?
I then realized that I could not just run a tns emulate android of my app made of .ts files: I had to compile them too. So I set up a Grunt task to do so, but it was not easy to handle the dependencies. I ended up with this Gruntfile.coffee in app/:
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-typescript'
grunt.config 'typescript',
build:
src: [
'**/*.ts'
'!*_modules/**'
]
options:
references: [
'tns_modules/bin/dist/definitions/**/*.d.ts'
]
target: 'es5'
sourceMap: false
declaration: false
module: 'commonjs'
noResolve: true
And it works with simple code, e.g. I'm able to extend a module like Observable by writing:
import observable = require("data/observable");
class Activities extends observable.Observable {
//...
}
I then compile with grunt (the .js files are created along with the .ts ones) and run with tns emulate android (with Genymotion emulator).
Is it the right architecture for my development? When I use Telerik Platform, the compilation process is hidden so I'm not sure I'm doing it right.
And now I'm trying to use Telerik's side-bar module directly in a page's XML file, the way they do it:
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded" xmlns:tsb="./tns_modules/bin/dist/apps/TelerikNEXT/TelerikUI/side-bar">
<tsb:SideBar title="MyApp">
...
But I get this error:
E/TNS.Native( 2456): TypeError: Cannot read property 'android' of undefined
E/TNS.Native( 2456): File: "/data/data/org.nativescript.scmobile/files/app/./tns_modules/bin/dist/apps/TelerikNEXT/TelerikUI/side-bar, line: 39, column: 39
Which corresponds to:
this._android = new com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer(this._context);
Any idea how I should include these modules? Note that I'm new to mobile dev.
The sidebar, which they're using in the example, is a (payed) controller from Telerik.
As such, it needs to be downloaded and added with tns library add {ios|android} /path/to/the/sidebar.
This command will read project.properties file from the specified shared library folder and will add a reference to it in your project. If in turn the shared library has references to other projects then these projects will be included recursively. As a result, this will create a new folder lib which is sibling to already existing app and platforms.
http://docs.nativescript.org/runtimes/android/external-libs/resource-libs