jueves, 17 de noviembre de 2022

React Native run-android notes

 

  • runAndroid:
    • ...logger.info('JS server already running.')...
    • buildAndRun
      • cmd = process.platform.startsWith('win') ? 'gradlew.bat' : './gradlew';
      • runOnAllDevices
        • ...logger.info('Installing the app...');...
        • tryLaunchAppOnDevice
          • ...const {appId, appIdSuffix} = args;...
          • ...shell am start -n...

viernes, 4 de noviembre de 2022

capacitor-community / text-to-speech: "Not yet initialized or not available on this device"

Sending plugin error: {"save":false,"callbackId":"...","pluginId":"TextToSpeech",
"methodName":"speak","success":false,"error":{"message":"Not yet initialized or
not available on this device.","code":"UNAVAILABLE"}}

It happened to me only on the emulator. On a real device, it worked.


miércoles, 1 de junio de 2022

Re: How to bundle and use custom web fonts in SPFx projects (Prod mode)

SPFx: 1.14/1.15.0-rc.0 

I followed How to bundle and use custom web fonts in SPFx projects but didn't work for me in "Prod mode" (gulp bundle --ship && gulp package-solution --ship). It worked for me at "Dev time" (gulp serve in Workbench or in a Sharepoint page in "full trust client-side solution" mode, no --ship).

To make it work I had to change the outputPath value (in fontLoaderConfig) from 'fonts/' to '/'.


const fontLoaderConfig = {
test: /\.(woff(2)?)(\?v=\d+\.\d+\.\d+)?$/, // I'm only checking for woff2
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: '/'
}
}]
};


I noticed that the runtime font references were like: https://[mySite].sharepoint.com/sites/appcatalog/ClientSideAssets/[GUID]/fonts/[myFont].woff2 but visiting https://[mySite].sharepoint.com/sites/appcatalog/ClientSideAssets/[GUID], all the assets were at the same level, like https://[mySite].sharepoint.com/sites/appcatalog/ClientSideAssets/[GUID]/[myFont].woff2.


jueves, 17 de febrero de 2022

AWS SES MessageRejected 400 Bad Request

 Are you on the SES sandbox and trying to send messages to an email address different than the verified one? Or to a domain different than the verified one? 😛



martes, 5 de octubre de 2021

MODULE_NOT_FOUND using New Relic with Nest (NestJS) 8

When adding the newrelic.js file in the root of the NestJS project, and then building it and running it in prod mode:

> node dist/main

node:internal/modules/cjs/loader:936

  throw err;

  ^

Error: Cannot find module '/.../apps/backend/dist/main'

    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)

    at Function.Module._load (node:internal/modules/cjs/loader:778:27)

    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)

    at node:internal/main/run_main_module:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}

In this case, tsc compiles just the newrelic.js file in your dist folder.


Move the newrelic.js to the same directory as your main.ts file (normally src/).

Complete installation instructions: https://discuss.newrelic.com/t/new-relic-for-nestjs/91812. I didn't follow all those for Nest 8 though. In my case:

  1. Same.
  2. Same.
  3. Same.
  4. Same. It didn't work with import _ from 'newrelic';. In that way, it got stripped from the compiled JS.
  5. 6. 7. I didn't need to. The newrelic.js automatically ended up in the dist/ folder.





jueves, 2 de septiembre de 2021

MongoDB Atlas notes

Notes

  • Remember to create a Project per environment (ref)
    • Every database user in a project has access to all the database deployments in the project (you can still restrict access to specific database names across all the deployments)
    • The VPC peering configuration is done per project, then at the AWS side, any peered VPC will have access to all the database deployments and databases)