Strange error trying to run ember tests on debian linux - linux

All our tests pass on multiple macOS machines, and on semaphore-ci, but when we try to build and run tests on a new debian box, we get this error in loader.js:143
not ok 1320 Chrome 72.0 - TestLoader Failures: zipbooks/tests/unit/utils/request-log-test: could not be loaded
---
actual: >
null
stack: >
TypeError: Cannot read property 'exports' of undefined
at Module._reify (http://localhost:45371/assets/vendor.js:148:59)
at Module.reify (http://localhost:45371/assets/vendor.js:135:27)
at Module.exports (http://localhost:45371/assets/vendor.js:109:10)
at Module._reify (http://localhost:45371/assets/vendor.js:148:59)
at Module.reify (http://localhost:45371/assets/vendor.js:135:27)
at Module.exports (http://localhost:45371/assets/vendor.js:109:10)
at Module._reify (http://localhost:45371/assets/vendor.js:148:59)
at Module.reify (http://localhost:45371/assets/vendor.js:135:27)
at Module.exports (http://localhost:45371/assets/vendor.js:109:10)
at requireModule (http://localhost:45371/assets/vendor.js:32:18)
message: >
Died on test #1 at TestLoader.moduleLoadFailure (http://localhost:45371/assets/test-support.js:11150:24)
at TestLoader.<anonymous> (http://localhost:45371/assets/test-support.js:10463:16)
at TestLoader.require (http://localhost:45371/assets/test-support.js:10451:27)
at TestLoader.loadModules (http://localhost:45371/assets/test-support.js:10443:16)
at loadTests (http://localhost:45371/assets/test-support.js:11174:22)
at start (http://localhost:45371/assets/test-support.js:10857:33)
at Module.callback (http://localhost:45371/assets/tests.js:20710:25): Cannot read property 'exports' of undefined
Log: |
{ type: 'info',
text: '\'Unit assertion failed and test has been paused for inspection.\'\n' }
{ type: 'error',
text: '{ module: \'TestLoader Failures\',\n name: \'zipbooks/tests/unit/utils/request-log-test: could not be loaded\',\n result: false,\n message: \'Died on test #1 at TestLoader.moduleLoadFailure (http://localhost:45371/assets/test-support.js:11150:24)\\n at TestLoader.<anonymous> (http://localhost:45371/assets/test-support.js:10463:16)\\n at TestLoader.require (http://localhost:45371/assets/test-support.js:10451:27)\\n at TestLoader.loadModules (http://localhost:45371/assets/test-support.js:10443:16)\\n at loadTests (http://localhost:45371/assets/test-support.js:11174:22)\\n at start (http://localhost:45371/assets/test-support.js:10857:33)\\n at Module.callback (http://localhost:45371/assets/tests.js:20710:25): Cannot read property \\\'exports\\\' of undefined\',\n actual: null,\n testId: \'8629d10a\',\n negative: false,\n runtime: 1,\n todo: false,\n source: \'TypeError: Cannot read property \\\'exports\\\' of undefined\\n at Module._reify (http://localhost:45371/assets/vendor.js:148:59)\\n at Module.reify (http://localhost:45371/assets/vendor.js:135:27)\\n at Module.exports (http://localhost:45371/assets/vendor.js:109:10)\\n at Module._reify (http://localhost:45371/assets/vendor.js:148:59)\\n at Module.reify (http://localhost:45371/assets/vendor.js:135:27)\\n at Module.exports (http://localhost:45371/assets/vendor.js:109:10)\\n at Module._reify (http://localhost:45371/assets/vendor.js:148:59)\\n at Module.reify (http://localhost:45371/assets/vendor.js:135:27)\\n at Module.exports (http://localhost:45371/assets/vendor.js:109:10)\\n at requireModule (http://localhost:45371/assets/vendor.js:32:18)\' }\n' }
We cannot find any information or have any guesses what might be causing this error.
ember-cli: 3.1.4
node: 8.5.0
os: linux x64
The pattern I'm seeing is that any test that uses setupTest, setupApplicationTest or setupRenderingTest is failing. Regular qunit tests that dont have any setup hooks pass fine.

The problem was not installing the yarn dependencies in our in-repo addon 😑

The most likely cause is binary dependencies that are platform-specific. Have you tried running npm rebuild first? Certain dependencies (such as node-sass) use binaries that are platform-specific, and need to be rebuilt. If that's your issue, if you ever need to do this in an automated fashion, you'll want to limit the scope of the rebuild to only the necessary dependencies, e.g. npm rebuild some-package some-other-package rather than the all inclusive npm rebuild
Unfortunately, yarn has yet to implement the rebuild feature, so we've moved back to npm, for that and other reasons. -- link to issue in GitHub

Related

Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1

I begin new project with NativeScript, but after more and more try i couldn't fix my error.
After build my application with:
tns run android --device Pixel_4_API_30
i have this error :
Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.**
...............................................................................................
My trace loge :
#############################################################################
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Debug level logging will leak security sensitive information!
https://docs.gradle.org/6.4/userguide/logging.html#sec:debug_security
#############################################################################
Command gradlew.bat failed with exit code 1
Will send the following information to Google Analytics: {
type: 'googleAnalyticsData',
category: 'CLI',
googleAnalyticsDataType: 'event',
action: 'Performance',
label: 'AndroidProjectService__buildProject',
customDimensions: { cd2: 'Angular', cd9: 'false', cd5: 'CLI' },
value: 3529
}
Error: Command gradlew.bat failed with exit code 1
at Errors.failWithOptions (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\common\errors.js:157:27)
at Errors.fail (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\common\errors.js:130:21)
at GradleCommandService.<anonymous> (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\services\android\gradle-command-service.js:40:30)
at Generator.throw (<anonymous>)
at rejected (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\services\android\gradle-command-service.js:6:65)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
tns info :
√ Getting NativeScript components versions information...
√ Component nativescript has 7.2.0 version and is up to date.
‼ Update available for component #nativescript/core. Your current version is 7.1.4 and the latest available version is 7.3.0.
√ Component #nativescript/ios has 7.2.0 version and is up to date.
√ Component #nativescript/android has 7.0.1 version and is up to date.
Gradle is connected to Java so check your installed version is 8. If not then get the correct version and try again. ns doctor is your friend!
If that doesn't work, stop any java and emulator (android/qemu) related tasks/processes and try again.
If that fails try rebooting your computer and test again.

How do I make Gatsby + netlify website work on my machine?

I deployed an app with netlify + gatsby default options and then I cloned that repo, so I can edit the style. The problem is that it doesn't work on my machine, the following error persists:
2 problems (0 errors, 2 warnings)
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
$black: #2b2523;
^
Invalid CSS after "...black: #2b2523;": expected 1 selector or at-rule,
was ".navbar .navbar-men"
in /Users/micazev/Documents/ecominimalismo.com/src/components/all.sass
(line 11, column 17)
File: src/components/all.sass
failed Building development bundle - 22.833s
ERROR Failed to compile with 1 errors 14:39:49
â €
error in ./src/components/all.sass
â €
Module build failed (from
./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from
./node_modules/sass-loader/dist/cjs.js):
$black: #2b2523;
^
Invalid CSS after "...black: #2b2523;": expected 1 selector or at-rule,
was ".navbar .navbar-men"
in /Users/micazev/Documents/ecominimalismo.com/src/components/all.sass
(line 11, column 17)
at /Users/micazev/Documents/ecominimalismo.com/node_modules/webpack/lib/Norm
alModule.js:316:20
at /Users/micazev/Documents/ecominimalismo.com/node_modules/loader-runner/li
b/LoaderRunner.js:367:11
at /Users/micazev/Documents/ecominimalismo.com/node_modules/loader-runner/li
b/LoaderRunner.js:233:18
at context.callback (/Users/micazev/Documents/ecominimalismo.com/node_module
s/loader-runner/lib/LoaderRunner.js:111:13)
at Object.callback (/Users/micazev/Documents/ecominimalismo.com/node_modules
/sass-loader/dist/index.js:89:7)
at Object.done [as callback] (/Users/micazev/Documents/ecominimalismo.com/no
de_modules/neo-async/async.js:8069:18)
at options.error (/Users/micazev/Documents/ecominimalismo.com/node_modules/n
ode-sass/lib/index.js:294:32)
# ./src/components/Layout.js 17:0-20
# ./src/templates/blog-post.js
# ./src/cms/preview-templates/BlogPostPreview.js
# ./src/cms/cms.js
# multi ./node_modules/gatsby-plugin-netlify-cms/cms.js
./node_modules/gatsby-plugin-netlify-cms/cms-identity.js ./src/cms/cms.js
My repo is: https://github.com/micazev/ecominimalismo.com
I don't know what other info I could give. Please, help.
According to some threads about that starter, there's a bug about the Sass loaders that causes this issue. You have many solutions provided in this GitHub thread:
Add options to the gatsby-plugin-sass:
{
resolve: 'gatsby-plugin-sass',
options: {
indentedSyntax: true
}
}
This will allow the loader to understand the indented syntax of Sass.
Changing the extension from .sass to .scss, changing also all the references in the project: you'll need to add semicolons (;) and braces ({}) when needed.
Obviously, the second one is easier and safer.

How to fix CustomRepositoryCannotInheritRepositoryError on nestjs app?

Havin problem to run nestjs app.
Current ecosystem:
- Windows 10
- node ver: v12.10.0
- npm ver: 6.10.3
- nestjs ver: 6.14.2
Steps to reproduce:
git clone https://github.com/gandra/nestjs-task-managament
cd nestjs-task-managament
npm i
npm run start
Receiving following error:
CustomRepositoryCannotInheritRepositoryError: Custom entity repository TaskRepository cannot inherit Repository class without entity being set in the #EntityRepository decorator.
at new CustomRepositoryCannotInheritRepositoryError (C:\learn\node\nestjs-task-managament\node_modules\typeorm\error\CustomRepositoryCannotInheritRepositoryError.js:10:28)
at EntityManager.getCustomRepository (C:\learn\node\nestjs-task-managament\node_modules\typeorm\entity-manager\EntityManager.js:607:23)
at Connection.getCustomRepository (C:\learn\node\nestjs-task-managament\node_modules\typeorm\connection\Connection.js:365:29)
at getCustomRepository (C:\learn\node\nestjs-task-managament\node_modules\#nestjs\typeorm\dist\typeorm.providers.js:15:68)
at InstanceWrapper.useFactory [as metatype] (C:\learn\node\nestjs-task-managament\node_modules\#nestjs\typeorm\dist\typeorm.providers.js:20:24)
at Injector.instantiateClass (C:\learn\node\nestjs-task-managament\node_modules\#nestjs\core\injector\injector.js:291:55)
at callback (C:\learn\node\nestjs-task-managament\node_modules\#nestjs\core\injector\injector.js:75:41)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Injector.resolveConstructorParams (C:\learn\node\nestjs-task-managament\node_modules\#nestjs\core\injector\injector.js:116:24)
at async Injector.loadInstance (C:\learn\node\nestjs-task-managament\node_modules\#nestjs\core\injector\injector.js:79:9)
Seems that following 2 things fixed issue.
First I have changed TaskRepository annotation from #EntityRepository() to #EntityRepository(Task). After that fix I have got error EntityMetadataNotFound.
Then I have changed TypeOrm entities con in file src/config/typeorm.config.ts and replaced entities: [__dirname + '/../**/*.entity.ts'], with entities: [__dirname + '/../**/*.entity.{js,ts}'],.

PhantomJS has crashed - Fatal Windows exception, code 0xc0000005

We have built a application using EmberJS. We got a failure message when we test the application using ember test. Here I mentioned the error message
OS: Windows 8(64-bit)
PhantomJS: 2.1.1
PhantomJS - error
---
message: >
Error:
Non-zero exit code: 3221225477
Stderr:
Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.
Log: |
{ type: 'error', text: 'Error: Browser exited unexpectedly' }
{ type: 'error', text: 'Non-zero exit code: 3221225477' }
{ type: 'error',
text: 'Fatal Windows exception, code 0xc0000005.\r\nPhantomJS has crashed. Please read the bug reporting guide at\r\n<http://phantomjs.org/bug-reporting.html> and file a bug report.\r\n'
}
I was having a very similar problem running PhantomJS on Windows 10 in the WSL.
I have found that:
The crash might be originating in the QT WebSocket handling code.
Setting the Karma transports setting to polling solved my issue and PhantomJS does no longer crash on startup.
In your Karma.conf.js add :
transports: ['polling']
Reference Link
PhantomJS Crashing

Trouble setting up karma-cordova (Linux)

First time doing anything on karma or linux so forgive me if I have made an obvious mistake.
Trying to run basic tests on karma-jasmine using cordova.
On karma start I get the following error logs:
30 10 2015 17:33:28.644:WARN [karma]: No captured browser, open http://localhost:9876/
30 10 2015 17:33:28.651:INFO [karma]: Karma v0.13.14 server started at http://localhost:9876/
using settings: { platforms: [ 'android', 'ios' ],
mode: 'emulate',
hostip: '10.0.2.2',
target: '0468de2a213eae29',
plugins: [ 'org.apache.cordova.console' ] }
30 10 2015 17:33:28.654:INFO [launcher]: Starting browser undefined on Cordova
30 10 2015 17:33:28.655:ERROR [launcher]: [TypeError: Object undefined on Cordova has no method 'on']
TypeError: Object undefined on Cordova has no method 'on'
at /home/phil/node_modules/karma/lib/launcher.js:94:17
at next (/home/phil/node_modules/karma/node_modules/batch/index.js:118:7)
at Batch.end (/home/phil/node_modules/karma/node_modules/batch/index.js:154:5)
at launch (/home/phil/node_modules/karma/lib/launcher.js:110:11)
at invoke (/home/phil/node_modules/karma/node_modules/di/lib/injector.js:75:15)
at Server.<anonymous> (/home/phil/node_modules/karma/lib/server.js:170:24)
at Server.g (events.js:180:16)
at Server.emit (events.js:92:17)
at net.js:1056:10
at process._tickCallback (node.js:448:13)
[spawn] stdout: Fetching plugin "org.apache.cordova.console" via npm
[spawn] stdout: WARNING: org.apache.cordova.console has been renamed to cordova-plugin-console. You may not be getting the latest version! We suggest youcordova plugin rm org.apache.cordova.consoleandcordova plugin add cordova-plugin-console.
Fetching plugin "org.apache.cordova.console" via cordova plugins registry
[spawn] stdout: Plugin "org.apache.cordova.console" already installed on android.
[spawn] stdout: Plugin "org.apache.cordova.console" already installed on ios.
[spawn] stderr: Platform android already added.
[spawn] stdout: WARNING: Applications for platform ios can not be built on this OS - linux.
[spawn] stderr: Platform ios already added.
Done adding platforms
[spawn] stdout: Running command: /tmp/cordova_test/platforms/android/cordova/build
[spawn] stderr: [Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
[spawn] stdout: ERROR building one of the platforms: Error: /tmp/cordova_test/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
[spawn] stderr: Error: /tmp/cordova_test/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/root/.nvm/v0.10.40/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
30 10 2015 17:33:34.455:ERROR [launcher.cordova]: "cordova build" failed with code 1
Below is my karma.conf.js file:
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'*.js',
'test/test1/test1.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preproces sor
preprocessors: {
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WAR N || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file chan ges
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launc her
browsers: ['Cordova'],
cordovaSettings: {
platforms:['android', 'ios'],
mode: 'emulate',
hostip: '10.0.2.2',
target :'0468de2a213eae29',
plugins: ['org.apache.cordova.console']
},
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
plugins: [
'karma-cordova-launcher',
'karma-jasmine',
'karma-cordova-launcher'
],
// Concurrency level
// how many browser should be started simultanous
concurrency: Infinity
})
}
Any advice appreciated, cheers!
Seems that the user running karma has not set the ANDROID_HOME environment variable.
Try opening the terminal and typing:
export ANDROID_HOME=/path/to/your/android/sdk
export PATH=$PATH:$ANDROID_HOME/bin
You can also add those lines to the user .bashrc to load them in each login.

Resources