Why does sencha build app fail? - build

I'm allways running into this exception when I try to build my app with the sencha commandline tools. However, other apps seem to work fine. What am I missing?
UPDATE
I figured out it has something to do with the fact that I want my buildPath to be outside of the app directory. My section in the app.json looks like this:
"buildPaths": {
"production": "../deploy/frontenddemo/production",
"testing": "../deploy/frontenddemo/testing",
"package": "../deploy/frontenddemo/package",
"native": "../deploy/frontenddemo/native"
},
If I change it to:
"buildPaths": {
"production": "build/production",
...
},
Everything works as expected. I don't know why. It should be possible to have the builds outside the app directory I guess.

Ok, after a lot of try and error. I found the root cause of this issue.
My app.json looked like this:
"archivePath": "../deploy/frontenddemo/archive/",
"buildPaths": {
"testing": "../deploy/frontenddemo/testing",
"production": "../deploy/frontenddemo/production",
"package": "../deploy/frontenddemo/package",
"native": "../deploy/frontenddemo/native"
},
The problem with this structure is that both archive and builds produce a directory "sencha" outside of the configured path. Meaning they both create ../deploy/frontenddemo/sencha
with different contents. I wonder if that is documented somewhere?
The fix was easy. I just changed the paths to this:
"archivePath": "../deploy/frontenddemo/archive/",
"buildPaths": {
"testing": "../deploy/frontenddemo/builds/testing",
"production": "../deploy/frontenddemo/builds/production",
"package": "../deploy/frontenddemo/builds/package",
"native": "../deploy/frontenddemo/builds/native"
},

I've had previous issues deploying directly to a web server such as MAMP, or even Mac's default web server, in ~/Sites/
Have you tried changing your deployment directory to something other then MAMP, and then manually copy/paste it over?
Also, what exact version of the SDK are you using? 2.1 beta 3 was released a bit ago, as well as a new Sencha Cmd 3.0.0.122 (used to be called Sencha SDK Tools).
Forum Announcement: Sencha Touch 2.1.0 Beta 3 is available

Related

My build and package gives me an older version of my app

i'm using Electron for the first time and have a problem.
I used a sample to make an app with Angular and Electron. When I changed a little bit i made a build to test if things are right. Since that i made a lot of new functions and updates. Now when i try to build/package my app, i got the same version i have made at the beginning and not the version i'm seeing when i made npm-run-all -p electron:serve ng:serve what i'm doing wrong?
I have used electron-forge, i have used electron-packager and them both got the same old version builded. And i don't know what to do now.
try with extraMetadata in your package.json :
{
"build": {
...,
"extraMetadata": {
"version": "X.Y.Z"
},
...
}

Metro Bundler fails while trying to resolve module `immer` from redux-toolkit

I'm building a react native app using Expo and Expo Go to test it on an android device. It has been working flawlessly until today. I encoutered an error on one of my components with this kind of error:
Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference
Solution seemed to me to clear cache yarn cache clean. I also cleared cache on the Expo Go app. But this led me to Metro Bundler failing with this error:
Android Bundling failed 1279ms
While trying to resolve module `immer` from file `H:\my_project\app\node_modules\#reduxjs\toolkit\dist\redux-toolkit.cjs.production.min.js`, the package `H:\my_project\app\node_modules\immer\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`H:\my_project\app\node_modules\immer\dist\immer.esm.mjs`. Indeed, none of these files exist:
* H:\my_project\app\node_modules\immer\dist\immer.esm.mjs(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
* H:\my_project\app\node_modules\immer\dist\immer.esm.mjs\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
When checking H:\my_project\app\node_modules\immer\dist\, I do find an immer.esm.mjs file but no H:\my_project\app\node_modules\immer\dist\immer.esm.mjs\ folder with an index file in it.
So I tried to manually remove node_modules/ and reinstall packages with yarn, restart the Expo server, doing all this after restarting my machine, even ran expo upgrade, removed .expo/, removed yarn.lock, but I keep getting the same error.
This leaves me quite confused. Thank you for your suggestions on what to do.
Here are the dependencies versions used as in my package.json:
"#reduxjs/toolkit": "^1.8.1",
"#types/react-redux": "^7.1.22",
"expo": "~45.0.0",
"react": "17.0.2",
"react-native": "0.68.2",
"react-redux": "8.0.1",
"redux": "4.2.0"
Fix
As suggested in this redux-toolkit issue, there seems to be an issue with immer version 9.0.13. Temporary fix suggested there is working for me, adding immer#9.0.12 to my resolutions in packages.json:
"resolutions": {
"immer": "9.0.12"
}
Update
This PR on immer resolved this issue (9.0.14). I can confirm the above fix isn't needed anymore on my side. Looks like my bad luck came from some breaking changes being pushed on a minor release.

AWS-SDK in nodejs Lambda function cannot find endpoint-cache module

I've been refactoring some of our AWS lambda functions and with this most recent version I am getting the following error:
"Payload": "{\"errorMessage\":\"Cannot find module '../vendor/endpoint-cache'\",\"errorType\":\"Error\",\"stackTrace\":[\"Function.Module._load (module.js:474:25)\",\"Module.require (module.js:596:17)\",\"require (internal/module.js:11:18)\",\"Object.<anonymous> (/var/task/node_modules/aws-sdk/lib/core.js:76:18)\",\"Module._compile (module.js:652:30)\",\"Object.Module._extensions..js (module.js:663:10)\",\"Module.load (module.js:565:32)\",\"tryModuleLoad (module.js:505:12)\",\"Function.Module._load (module.js:497:3)\"]}"
This module is within the vendor folder of the aws-sdk node module.
I checked the deployment artifacts to make sure that the folder exists and I've tried downgrading to the older version of the aws-sdk that was being used before.
Dependencies in package.json:
"dependencies": {
"aws-sdk": "^2.59.0",
"moment": "^2.22.2",
"underscore": "^1.8.3"
},
The build server runs npm-install and then
$path = Get-Location
$thisProject = "$($path)\pathToProject\*"
Compress-Archive -Path $thisProject -DestinationPath thisProject.zip
Been stuck on this for a while so any help is greatly appreciated.
I ran into this issue a few months back. Turns out I needed to make sure the package lock file was included in the project and had the aws-sdk version set
I had this issue yesterday, I solved it by removing the aws-sdk in the package.json & deleting + reinstalling my node_modules folder. Hope this solves your problem.
I think the aws-sdk is already included by default.
I actually encountered the same problem. And in my case the reason was in the Compress-Archive function, run on Windows. If I pack lambda with Compress-Archive, then Lambda call fails with the error in question above. But if I unpack .zip and pack with regular Windows "send to compressed directory" - everything works fine. I've found some similar issue in PowerShell github space, which made me think this is a common problem.
The problem was fixed in one of the latest releases of PowerShell Core (not sure about classic PowerShell). I'm not sure about the exact release which fixes this problem, but it was there in v.6.1, and in v.6.2.2 it's gone.
The recommended approach to specifying the SDK you want in a Lambda function is to create a lambda layer with your desired version. See here: https://aws.amazon.com/blogs/compute/working-with-aws-lambda-and-lambda-layers-in-aws-sam/

Upgrade Expo react-native-svg dependency version

My Expo project requires the latest version of react-native-svg library to render my SVGs correctly. Currently it's version 9.3.5
From package-json.lock, I see that my current Expo SDK 32 has version 8.0.10 listed.
"dependencies": {
"react-native-svg": {
"version": "8.0.10",
"resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-8.0.10.tgz",
"integrity": "sha512-gsG5GUdvlox67+ohLnq3tZSqiYBmz4M5lKKeUfnJZ8EPrMMS5ZgaVj7Zcccee1VvINS5xQaoenUJdha/GEo34w==",
"requires": {
"color": "^2.0.1",
"lodash": "^4.16.6",
"pegjs": "^0.10.0"
}
}
}
I have tried just installing latest react-native-svg alongside Expo by using
npm install react-native-svg#9.3.5
However, when running the app I get an error:
Tried to register two views with the same name RNSVGRect
So how can I force Expo to use the latest version? I don't see any react-native-svg dependencies anywhere and changing the package-lock.json directly doesn't seem like a good idea.
Short answer to my question is: you can't. At least not without some ugly hacks that are more trouble than they're worth.
The good news is that SDK 33 now comes with "react-native-svg": "~9.4.0" as a dependency and this is almost the latest version as of this writing.

Can no longer run my ember app locally in Windows 7

I did my first development in a Win7 machine, then switched to a Mac when I got that, which was great due to the speed of building with ember server running. I've been keeping everything in a Git repo. Everything works fine running ember server from my Mac.
Now, when I do a fresh clone from the repo on my Win7 computer, then do npm install and bower install (both of which complete fine), when I run ember server next, I get a bunch of errors saying ENOTEMPTY, directory not empty (path, blah blah blah).
It's complaining about some folder in the tmp directory, which the server command is creating and putting stuff into all by itself, so I don't know what it's complaining about.
I've been finagling with this about 5 different times now, but without success.
Ember CLI version is 0.1.1
Ember version is 1.6
Here's an example of one of the errors, but they're all similar (and similarly unhelpful):
ENOTEMPTY, directory not empty 'c:\Dev\star\tmp\remover-tmp_dest_dir-sRc08q1q.tm
p\templates'
Error: ENOTEMPTY, directory not empty 'c:\Dev\star\tmp\remover-tmp_dest_dir-sRc0
8q1q.tmp\templates'
at Object.fs.rmdirSync (fs.js:623:18)
at rmkidsSync (c:\Dev\star\node_modules\ember-cli\node_modules\rimraf\rimraf
.js:247:11)
at rmdirSync (c:\Dev\star\node_modules\ember-cli\node_modules\rimraf\rimraf.
js:237:7)
at fixWinEPERMSync (c:\Dev\star\node_modules\ember-cli\node_modules\rimraf\r
imraf.js:150:5)
at Function.rimrafSync [as sync] (c:\Dev\star\node_modules\ember-cli\node_mo
dules\rimraf\rimraf.js:216:26)
at Remover._remove (c:\Dev\star\node_modules\ember-cli\node_modules\broccoli
-file-remover\index.js:46:10)
at c:\Dev\star\node_modules\ember-cli\node_modules\broccoli-file-remover\ind
ex.js:60:14
at Array.forEach (native)
at c:\Dev\star\node_modules\ember-cli\node_modules\broccoli-file-remover\ind
ex.js:59:12
at $$$internal$$tryCatch (c:\Dev\star\node_modules\ember-cli\node_modules\rs
vp\dist\rsvp.js:470:16)
file added bootstrap.min.js
file added favicon.ico
file added sb-admin-2.js
Okay, I managed to do something that worked. I had forgotten I needed to disable Windows Indexing on my tmp folder at least (I did it for the whole cloned project):
Windows Key, type "Indexing Options"
Click the drive, then Modify
Uncheck places you don't want indexed (like the tmp folder)
If you use Sublime, go to Perferences --> Settings - User and add the following:
"folder_exclude_patterns":
[
"tmp/*",
],
Finally, I just had to keep doing ember server, stopping it, and doing it again until it build successfully (took around 5 tries).