Firebase SDK not working on Google Cloud Console - firebase

Firebase SDK on Google Cloud Console is not working. Upon using
firebase init
We get
/usr/local/nvm/versions/node/v16.1.0/lib/node_modules/firebase-tools/lib/emulator/portUtils.js:9
dns.setDefaultResultOrder("ipv4first");
^
TypeError: dns.setDefaultResultOrder is not a function
at Object. (/usr/local/nvm/versions/node/v16.1.0/lib/node_modules/firebase-tools/lib/emulator/portUtils.js:9:5)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object. (/usr/local/nvm/versions/node/v16.1.0/lib/node_modules/firebase-tools/lib/emulator/registry.js:6:19)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
Is anyone having these issues??

Upgrade the version node installed on your system.
The current version is 16.15.1, you are using 16.1.0. IIRC the minimum v16 version is 16.4 or 16.5 (both are old)

Related

Firebase deployment works locally but not on GitHub Action

I'm trying to build a CI/CD pipeline for my project that uses Firebase Cloud Functions.
The functions code is written in TypeScript.
Deploying the code from my local MacBook works perfectly. However, when deploying the same exact code from the GitHub Action runner it fails with an error:
/home/runner/work/geonotes-backend/geonotes-backend/functions/lib/handlers/createNoteActionHandler.js:11
return sendOutput({ note_id: note?.id });
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1052:16)
at Module._compile (internal/modules/cjs/loader.js:1100:27)
at Module._compile (pkg/prelude/bootstrap.js:1394:32)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
at Module.load (internal/modules/cjs/loader.js:984:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1024:19)
at Module.require (pkg/prelude/bootstrap.js:1338:31)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/runner/work/geonotes-backend/geonotes-backend/functions/lib/index.js:28:51)
This looks like Firebase is not accepting the optional chaining syntax, but it should since the function runs on Node.js 14.
Furthermore, the same syntax is accepted perfectly by the CLI running on my machine.
I have verified that both my machine and the GitHub runner are using the same versions:
Node.js v14.17.4
NPM v6.14.14
Firebase CLI v9.16.0
TypeScript v4.3.5
I have also tried to run my action on macos-latest instead of ubuntu-latest with no luck.
This is one of the runs that is failing, with --debug enabled:
https://github.com/emilioschepis/geonotes-backend/runs/3261106553
Does anyone have an idea about what could be wrong?

ReferenceError: navigator is not defined on "npm run build" Nextjs #andyet/simplewebrtc

I am creating video chat app with #andyet/simplewebrtc. And I am using nextjs dynamic import. Everything is working fine on localhost but when I try to create a build with "npm run build", I am getting navigator is not defined.
Build error occurred
ReferenceError: navigator is not defined
at Object. (/Users/apple/Documents/React Mac/next-webrtc/next-webrtc/node_modules/#andyet/simplewebrtc/lib/Hark.js:4:56)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (/Users/apple/Documents/React Mac/next-webrtc/next-webrtc/node_modules/#andyet/simplewebrtc/actions/Media.js:5:40)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) {
type: 'ReferenceError'
}
Just upgrade to #andyet/simplewebrtc version 1.30.2 and it will resolve the issue. They made the upgrade to this version before that it was not compatible with nextjs

how to make react-native-paper work with next.js?

I installed this example https://github.com/zeit/next.js/tree/master/examples/with-react-native-web and I added react-native-paper to it , when ever I use it ,I get this error
Error: Cannot find module 'react-native'
Require stack:
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/react-native-paper/lib/commonjs/styles/fonts.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/react-native-paper/lib/commonjs/styles/DefaultTheme.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/react-native-paper/lib/commonjs/core/theming.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/react-native-paper/lib/commonjs/index.js
- /Users/amesbahi/Code/with-react-native-web-app/.next/server/static/development/pages/index.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/next-server/server/require.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/next-server/server/load-components.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/next-server/server/api-utils.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/next-server/server/next-server.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/server/next.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/server/lib/start-server.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/cli/next-dev.js
- /Users/amesbahi/Code/with-react-native-web-app/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:954:17)
at Function.Module._load (internal/modules/cjs/loader.js:847:27)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object.<anonymous> (/Users/amesbahi/Code/with-react-native-web-app/node_modules/react-native-paper/lib/commonjs/styles/fonts.js:1:279)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object.<anonymous> (/Users/amesbahi/Code/with-react-native-web-app/node_modules/react-native-paper/lib/commonjs/styles/DefaultTheme.js:1:282)
at Module._compile (internal/modules/cjs/loader.js:1121:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
at Module.load (internal/modules/cjs/loader.js:976:32)
at Function.Module._load (internal/modules/cjs/loader.js:884:14)
here is a copy of my repo enter link description here
I've been struggling with this for a couple of days. Hope some one can help me
I had same approach and same issue as yours.
Here is how I made React Native Paper work in Next.js.
Build Next.js and React Native for Web(RNW) with Expo.io
Check this tutorial and make sure it's running on your local
Follow the Getting Started part and Using on the Web in React Native Paper Doc, however, regarding to next.config.js, this is all you need to do.
const { withExpo } = require("#expo/next-adapter");
const withImages = require("next-images");
const withFonts = require("next-fonts");
module.exports = withExpo(
withFonts(
withImages({
projectRoot: __dirname
})
)
);
Since Expo already provides these build-in plugin to load images and fonts, you don't need to manually add any loader for your webpack, just using it and it should work.

SQLITE IMPORTING PROBLEMS

I was importing a sqlite3 file with electron and come up with this problem
App threw an error during load
C:\projectSqlElectron\index.js:9
filename: path.join(__dirname, 'database.sqlite')
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:815:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
at Module.load (internal/modules/cjs/loader.js:735:32)
at Module._load (internal/modules/cjs/loader.js:648:12)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at loadApplicationPackage (C:\projectSqlElectron\node_modules\electron\dist\resources\default_app.asar\main.js:109:16)
at Object.<anonymous> (C:\projectSqlElectron\node_modules\electron\dist\resources\default_app.asar\main.js:155:9)
at Module._compile (internal/modules/cjs/loader.js:880:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)...
make sure it's the right path. or try path.join(__dirname, '/database.sqlite')

First Example Encore - Path must be a string. Received undefined

I try to use Encore in Symfony.
First example
I run command:
./node_modules/.bin/encore dev
and this return me error:
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1211:7)
at find (/www/testencore/node_modules/babel-loader/lib/resolve-rc.js:11:21)
at module.exports (/www/testencore/node_modules/#symfony/webpack-encore/lib/config/parse-runtime.js:64:47)
at Object.<anonymous> (/www/testencore/node_modules/#symfony/webpack-encore/bin/encore.js:18:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Your issue has to do with v7.1 of babel-loader. (cfr. https://github.com/symfony/webpack-encore/issues/40)
You can fix the issue by adding the following line to your package.json
"babel-loader": "7.0"
After this make sure to run yarn upgrade, webpack-encore should work again.
Note that this is a temporary fix. You should keep an eye on the github issue to see if there's a permanent fix available.
EDIT: This has been fixed since Encore 0.9.1, updating should solve the issue.

Resources