SQLITE IMPORTING PROBLEMS - sqlite

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')

Related

Firebase SDK not working on Google Cloud Console

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)

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.

`firebase serve --only functions` - Error: Sorry, we cannot connect to Google Cloud Services without a project ID

I have 2 HTTP functions. When deployed to cloud it is working good. But for development, when I try to serve them locally with
firebase serve --only functions
I am getting this error,
ERROR: Function load error: Code could not be loaded.
ERROR: Does the file exists? Is there a syntax error in your code?
ERROR: Detailed stack trace: /home/saiy2k/projects/ionic/grcloud/functions/node_modules/#google-cloud/common/src/util.js:545
throw util.missingProjectIdError;
^
Error: Sorry, we cannot connect to Google Cloud Services without a project ID. You may specify one with an environment variable named "GCLOUD_PROJECT". See https://googlecloudplatform.github.io/google-cloud-node/#//docs/guides/authentication for a detailed guide on creating an authenticated connection.
at Object.<anonymous> (/home/saiy2k/projects/ionic/grcloud/functions/node_modules/#google-cloud/common/src/util.js:54:29)
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)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/saiy2k/projects/ionic/grcloud/functions/node_modules/#google-cloud/common/src/service.js:30:12)
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)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/saiy2k/projects/ionic/grcloud/functions/node_modules/#google-cloud/common/src/grpc-service.js:38:15)
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)
⚠ functions: Failed to emulate handlePayment
⚠ functions: Failed to emulate testHTTPListener
i functions: No HTTPS functions emulated. Support for other function types are coming soon.
Tried setting a env variable like this,
firebase functions:config:set GCLOUD_PROJECT="gr-staging"
But got this error: Error: Invalid config name GCLOUD_PROJECT, cannot use upper case.
Had a look at this page: https://firebase.google.com/docs/functions/local-emulator
Any else to take care of, to serve the HTTP functions locally?
Firebase CLI: v3.10.1
My Package.json
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"#google-cloud/storage": "^0.4.0",
"child-process-promise": "^2.2.0",
"firebase-admin": "~4.2.1",
"firebase-functions": "^0.5.9",
"mkdirp": "^0.5.1",
"mkdirp-promise": "^4.0.0",
"moment": "^2.18.1",
"request": "^2.81.0",
"request-promise": "^4.2.1",
"typescript": "^2.4.2"
},
"private": true,
"devDependencies": {
"ts-loader": "^2.3.2",
"webpack-node-externals": "^1.6.0"
}
}
For what its worth, and by no means is this a good solution, but it works.
Commenting out the throw in /home/saiy2k/projects/ionic/grcloud/functions/node_modules/#google-cloud/common/src/util.js on line 545 that is causing the error causes no ill effect to the emulator that I can gather.
All of the objects that check function is receiving are either undefined or null in my instance so without checking back up the stack about why this should be i'm happy with this hack to get me back on the road!

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