Yeoman Generator fails with assertion error related to this.copy - yeoman

This is an older Yeoman generator that was setup using this.copy
this.copy('_editorconfig', '.editorconfig');
ERROR: AssertionError [ERR_ASSERTION]: Trying to copy from a source that does not exist: _editorconfig

The fix was due to changes in the way copy was handled.
this.fs.copy(
this.templatePath('_editorconfig'),
this.destinationPath('.editorconfig')
);
As a note this also was a fix for adding a gitignore
this.fs.copy(
this.templatePath('_gitignore'),
this.destinationPath('.gitignore')
);

Related

Electron fix "ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command"

I recently stepped down my electron application removed knex and sqlite since it was painfully complicated to creating a rebuild on windows also when i made an executable for windows sqlite database didn't seem to work. Linux executable worked fine with sqlite guessing the same with mac.
To use sqlite i had rebuilt the application using electron-rebuild. In order to clear the rebuild i did rm -rf node_modules && npm install
I have eventually decided to use IndexDB using dexie.
However now when i try to run my program from npm i get
ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
How do i fix this, why is it happening ?
NB: The application works just fine but this error i the terminal is just annoying and i have no idea why its happenning
Do a test,
electron /path/to/the/app [You will get that Error]
Try
electron --disable-gpu /path/to/the/app [You mayn't get that Error]
The fix was to add "--disable-gpu" to the command-line to force the
web view not to use gpu features. I was able to accomplish this in an
electron app by editing the package.json file in app root and changing
the line like "start": "electron ." to "start": "electron .
--disable-gpu"
Refer https://github.com/electron/electron/issues/7834#issuecomment-275802528
Based on Sudhakar RS answer , I made a script in my package.json to not use GL
here is my package.json
{
...
"scripts": {
"start": "electron --disable-gpu .", // --disable GL ERROR and use CPU
...
}
...
}
Then in your terminal run
npm run start
I had the same error running electron-quick-start but not when running electron-boilerplate.
Investigating the error I found this question and for me also, starting with "electron --disable-gpu ." prevents the error message. But I didn't have to do that with electron-boilerplate. So, comparing the two I traced the difference to the inclusion of electron-debug in electron-boilerplate and, ultimately, to this: process.stderr.fd.
Thus far, the minimal change I have found sufficient to avoid the error is:
diff --git a/main.js b/main.js
index 3508c8e..7df262b 100644
--- a/main.js
+++ b/main.js
## -2,6 +2,8 ##
const {app, BrowserWindow} = require('electron')
const path = require('path')
+process.stderr.fd;
+
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
So, now I am trying to understand what process.stderr.fd; does and how it prevents the error message from appearing. It seems odd that merely getting the file descriptor of stderr would prevent the error but evidently it does.
I am also curious about the relative merits of disabling the GPU Vs getting the file descriptor.
edit: it is sufficient to get the stream with process.stderr; it is not necessary to get the file descriptor.
My solution for issue:
"dev": ".electron-vue/dev-runner.js --disable-gpu"

error while reading extension file 'intellij_info_bundled.bzl'

we are trying to create a Scala project which uses Spark also but we are facing issue Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '#intellij_aspect//': No WORKSPACE file found in C:/users//_bazel_user/i45wuf6d/external/intellij_aspect. Is it has something missing in Intellij?
Scala file
package src.main.scala
object HelloWorld extends App {
def main(args: Array[String]) {
println("Hello, world!")
}
}
Build file
package(default_visibility = ["//visibility:public"])
load("#io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_test")
scala_library(
name = "hello-world",
srcs = glob(["src/main/scala/*.scala"]),
)
scala_test(
name = "Hello_test",
srcs = glob(["src/main/scala/*.scala"]),
size = "small", # Expect this test to run quickly
)
Work Space
workspace(name = "scala_example")
rules_scala_version="7522c866450cf7810eda443e91ff44d2a2286ba1" # update this as needed
http_archive(
name = "io_bazel_rules_scala",
url = "https://github.com/bazelbuild/rules_scala/archive/%s.zip"%rules_scala_version,
type = "zip",
strip_prefix= "rules_scala-%s" % rules_scala_version
)
load("#io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()`enter code here`
# register default scala toolchain
load("#io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
Command and Error from console
Command: C:\ProgramData\chocolatey\bin\bazel.exe build --tool_tag=ijwb:IDEA:community --keep_going --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --aspects=#intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect --override_repository=intellij_aspect=C:\Users\ADMIN.IdeaIC2017.3\config\plugins\ijwb\aspect --output_groups=intellij-compile-java,intellij-compile-py -- //...:all
INFO: Loading complete. Analyzing...
ERROR: Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '#intellij_aspect//': No WORKSPACE file found in C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/external/intellij_aspect.
INFO: Found 3 targets...
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
cannot create symbolic link bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: Cannot create junction (name=C:\users\admin\scalaprojects\example1\bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out, C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): Cannot create a file when that file already exists.
cannot create symbolic link bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: Cannot create junction (name=C:\users\admin\scalaprojects\example1\bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out, C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): Cannot create a file when that file already exists.
.
INFO: Building...
ERROR: command succeeded, but not all targets were analyzed.
INFO: Elapsed time: 18.108s, Critical Path: 0.05s
Make failed
This is a sample Helloworld program only
In general, like #Ittai, I would suggest you open an issue in the intellij plugin github repo.
Unfortunately, your version of the plugin is no longer supported. I, too, previously ran into an issue with an older version of the plugin and was recommended to upgrade to the latest version. Which resolved the specific issue I was facing.
When reporting the issue make sure to include the following bits of information:
intellij build number
plugin version number
rules_scala version
operating system (it seems your using Windows, while most users use unix based systems)
bazel release number
how you have opened the intellij project (BUILD file, WORKSPACE, .blazeproject)
Additionally, to verify this is in fact an issue with the plugin, I would also suggest you try to reproduce this issue on a Unix based system. It seems you are using Intellij
compile on Windows. This may be Windows specific issue with aspects not being recognized.
When attempting to reproduce, make sure to clone your repository in a separate directory, close the intellij project, and reopen the project

Webpack will not resolve JQuery-UI Definitions

I have the following code in my TS file...
require("jquery-ui/ui/widgets/datepicker.js");
require("angular-ui-date/dist/date.js");
When I run the code I get the following error...
Module not found: Error: Cannot resolve module 'jquery-ui/datepicker' in //code/my-app/node_modules/angular-ui-date/dist
# ./~/angular-ui-date/dist/date.js 3:66-97
So I ran tsd install jqueryui --save and then added the following to the same file as the require...
/// <reference path="../../../typings/jqueryui/jqueryui.d.ts" />
based on src/main/typescripts but I still get the same warning when running webpack
It seems to be a issue with latest version you are using. It has nothing to do with type definition. if you open angular-ui-date/dist/date.js you will find that it is requiring
require("jquery-ui/datepicker")
which does not exist
to workaround you could change it manually to require("jquery-ui/ui/widgets/datepicker") but that's a ugly solution i think.
There is also an issue on github and there is also suggestion for workaround
Please see the isse here
I added an alias to the resolve object in the webpack configuration file.
'resolve' : {
'alias' : {
'jquery-ui/datepicker' : 'jquery-ui/ui/widgets/datepicker'
},
},

Build PHP_CodeSniffer from sources with HHVM

I am trying to use PHP_CodeSniffer in my Hack project. I tried getting the phpcs.phar file from the repository and run it, but I get an error, something that seems to be a bug of HHVM (see #5140). So I tried building it to .phar myself. I ran the most obvious script:
scripts/build-phar.php
so
$ hhvm ./scripts/build-phar.php
This is the output I get:
Building phpcs phar
=> /devel/phpcs/phpcs.phar
Fatal error: Uncaught exception 'PharException' with message '/devel/phpcs/phpcs.phar is not a file' in /devel/phpcs/scripts/build-phar.php:43
Stack trace:
#0 /devel/phpcs/scripts/build-phar.php(43): Phar->__construct()
#1 {main}
I am not sure where to look or what to look for here. Could you please give me some advice on building a .phar from this?

Running "pub install" for dart-html5-samples leads to weird errors

I encountered some weird errors when running "pub install" for dart-html5-samples. The first one was:
Illegal argument(s): join(): part 0 was null, but part 1 was not.
The second one was:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Could not find package "unittest 0.0.0-r.13075" at http://pub.dartlang.org.
What's going on, and how do I fix it?
The first error is:
Illegal argument(s): join(): part 0 was null, but part 1 was not.
That's because pubspec.yaml contained:
dependencies:
htmlescape:
sdk: htmlescape
htmlescape no longer comes with the SDK. Removing the dependency fixed the problem. I simply made a copy of htmlescape.dart in my lib directory. Eventually, I won't need my own copy once the following bug is fixed:
http://code.google.com/p/dart/issues/detail?id=1657
The second error is:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Could not find package "unittest 0.0.0-r.13075" at http://pub.dartlang.org.
dart-html5-samples depends on vector_math which depends on unittest. I think they must have changed how unittest is loaded by pub. Running pub update fixed the problem.

Resources