Error while initializing Firebase in Flutter - firebase

My main.dart:
void main() async {
await preinit();
await di<FirebaseAuthService>().useEmulator();
await di<FirebaseFunctionsService>().useEmulator();
await initApp();
}
Part of my FirebaseAuthService:
#singleton
class FirebaseAuthService {
final FirebaseAuth _service;
FirebaseAuthService(FirebaseCoreService firebaseCoreService)
: _service = FirebaseAuth.instanceFor(app: firebaseCoreService.app);
}
Part of my FirebaseFunctionsService:
#injectable
class FirebaseFunctionsService {
final FirebaseFunctions _service;
FirebaseFunctionsService(FirebaseCoreService firebaseCoreService)
: _service = FirebaseFunctions.instanceFor(app: firebaseCoreService.app);
}
My FirebaseCoreService:
#singleton
class FirebaseCoreService {
final FirebaseApp _app;
FirebaseApp get app => _app;
FirebaseCoreService._(this._app);
#factoryMethod
static Future<FirebaseCoreService> create() async {
final app = await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
if (!kIsWeb) {
await FirebaseCrashlytics.instance
.setCrashlyticsCollectionEnabled(!kDebugMode);
}
return FirebaseCoreService._(app);
}
}
At Firebase.initializeApp that is called right after preinit() in main.dart, I get the following error:
"Error: Invalid argument(s): object cannot be a num, string, bool, or null
at Object.throw_ [as throw] (http://localhost:50958/dart_sdk.js:5080:11)
at JsObject.fromBrowserObject (http://localhost:50958/dart_sdk.js:61852:19)
at get [_ignoredServiceScripts] (http://localhost:50958/packages/firebase_core_web/firebase_core_web.dart.lib.js:147:35)
at firebase_core_web.FirebaseCoreWeb.new._initializeCore (http://localhost:50958/packages/firebase_core_web/firebase_core_web.dart.lib.js:182:27)
at _initializeCore.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at [_initializeCore] (http://localhost:50958/packages/firebase_core_web/firebase_core_web.dart.lib.js:177:20)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:50958/packages/firebase_core_web/firebase_core_web.dart.lib.js:199:36)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:50958/packages/firebase_core_web/firebase_core_web.dart.lib.js:198:20)
at initializeApp (http://localhost:50958/packages/firebase_core/firebase_core.dart.lib.js:105:59)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at Firebase.initializeApp (http://localhost:50958/packages/firebase_core/firebase_core.dart.lib.js:104:20)
at create (http://localhost:50958/packages/wa_flutter_questionnaire/data/firebase/firebase_core_service.dart.lib.js:26:49)
at create.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at FirebaseCoreService.create (http://localhost:50958/packages/wa_flutter_questionnaire/data/firebase/firebase_core_service.dart.lib.js:25:20)
at http://localhost:50958/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1903:130
at get_it_helper.GetItHelper.new.singletonAsync (http://localhost:50958/packages/injectable/src/get_it_helper.dart.lib.js:117:18)
at $36initGetIt (http://localhost:50958/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1903:16)
at $36initGetIt.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at Object.$36initGetIt [as $initGetIt] (http://localhost:50958/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1900:18)
at configureDependencies (http://localhost:50958/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1918:32)
at configureDependencies.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at Object.configureDependencies (http://localhost:50958/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1917:18)
at preinit (http://localhost:50958/packages/wa_flutter_questionnaire/main.dart.lib.js:55:16)
at preinit.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at Object.preinit (http://localhost:50958/packages/wa_flutter_questionnaire/main.dart.lib.js:52:18)
at main$ (http://localhost:50958/packages/wa_flutter_questionnaire/main_local.dart.lib.js:18:18)
at main$.next (<anonymous>)
at runBody (http://localhost:50958/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:50958/dart_sdk.js:40691:7)
at main$ (http://localhost:50958/packages/wa_flutter_questionnaire/main_local.dart.lib.js:17:18)
at http://localhost:50958/web_entrypoint.dart.lib.js:37:33
at Object._checkAndCall (http://localhost:50958/dart_sdk.js:5279:16)
at Object.dcall (http://localhost:50958/dart_sdk.js:5284:17)
at http://localhost:50958/dart_sdk.js:140291:18
at Generator.next (<anonymous>)
at http://localhost:50958/dart_sdk.js:40641:33
at _RootZone.runUnary (http://localhost:50958/dart_sdk.js:40511:59)
at _FutureListener.thenAwait.handleValue (http://localhost:50958/dart_sdk.js:35438:29)
at handleValueCallback (http://localhost:50958/dart_sdk.js:35999:49)
at _Future._propagateToListeners (http://localhost:50958/dart_sdk.js:36037:17)
at [_completeWithValue] (http://localhost:50958/dart_sdk.js:35872:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:50958/dart_sdk.js:35906:35)
at Object._microtaskLoop (http://localhost:50958/dart_sdk.js:40778:13)
at _startMicrotaskLoop (http://localhost:50958/dart_sdk.js:40784:13)
at http://localhost:50958/dart_sdk.js:36261:9"
My ignoredServiceScripts in part of firebase_core_web:
List<String> get _ignoredServiceScripts {
try {
JsObject ignored =
JsObject.fromBrowserObject('flutterfire_ignore_scripts');
if (ignored is Iterable) {
return (ignored as Iterable)
.map((e) => e.toString())
.toList(growable: false);
}
} catch (e) {
// Noop
}
return [];
}
I don't get this error while running my app on iOS, for example. Can you please help?
Update:
I changed JsObject.fromBrowserObject('flutterfire_ignore_scripts') to JsObject.fromBrowserObject(context['flutterfire_ignore_scripts']), so it doesn't fail with this error anymore, it does fail with another one (both on web, iOS, Android):
"Error: Expected a value of type 'Object', but got one of type 'Null'
at Object.throw_ [as throw] (http://localhost:59214/dart_sdk.js:5080:11)
at Object.castError (http://localhost:59214/dart_sdk.js:5039:15)
at Object.cast [as as] (http://localhost:59214/dart_sdk.js:5356:17)
at Object.as (http://localhost:59214/dart_sdk.js:6603:31)
at get [_ignoredServiceScripts] (http://localhost:59214/packages/firebase_core_web/firebase_core_web.dart.lib.js:147:65)
at firebase_core_web.FirebaseCoreWeb.new._initializeCore (http://localhost:59214/packages/firebase_core_web/firebase_core_web.dart.lib.js:182:27)
at _initializeCore.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at [_initializeCore] (http://localhost:59214/packages/firebase_core_web/firebase_core_web.dart.lib.js:177:20)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:59214/packages/firebase_core_web/firebase_core_web.dart.lib.js:199:36)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:59214/packages/firebase_core_web/firebase_core_web.dart.lib.js:198:20)
at initializeApp (http://localhost:59214/packages/firebase_core/firebase_core.dart.lib.js:105:59)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at Firebase.initializeApp (http://localhost:59214/packages/firebase_core/firebase_core.dart.lib.js:104:20)
at create (http://localhost:59214/packages/wa_flutter_questionnaire/data/firebase/firebase_core_service.dart.lib.js:26:49)
at create.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at FirebaseCoreService.create (http://localhost:59214/packages/wa_flutter_questionnaire/data/firebase/firebase_core_service.dart.lib.js:25:20)
at http://localhost:59214/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1903:130
at get_it_helper.GetItHelper.new.singletonAsync (http://localhost:59214/packages/injectable/src/get_it_helper.dart.lib.js:117:18)
at $36initGetIt (http://localhost:59214/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1903:16)
at $36initGetIt.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at Object.$36initGetIt [as $initGetIt] (http://localhost:59214/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1900:18)
at configureDependencies (http://localhost:59214/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1918:32)
at configureDependencies.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at Object.configureDependencies (http://localhost:59214/packages/wa_flutter_questionnaire/domain/theme_manager.dart.lib.js:1917:18)
at preinit (http://localhost:59214/packages/wa_flutter_questionnaire/main.dart.lib.js:55:16)
at preinit.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at Object.preinit (http://localhost:59214/packages/wa_flutter_questionnaire/main.dart.lib.js:52:18)
at main$ (http://localhost:59214/packages/wa_flutter_questionnaire/main_local.dart.lib.js:18:18)
at main$.next (<anonymous>)
at runBody (http://localhost:59214/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:59214/dart_sdk.js:40691:7)
at main$ (http://localhost:59214/packages/wa_flutter_questionnaire/main_local.dart.lib.js:17:18)
at http://localhost:59214/web_entrypoint.dart.lib.js:37:33
at Object._checkAndCall (http://localhost:59214/dart_sdk.js:5279:16)
at Object.dcall (http://localhost:59214/dart_sdk.js:5284:17)
at http://localhost:59214/dart_sdk.js:140291:18
at Generator.next (<anonymous>)
at http://localhost:59214/dart_sdk.js:40641:33
at _RootZone.runUnary (http://localhost:59214/dart_sdk.js:40511:59)
at _FutureListener.thenAwait.handleValue (http://localhost:59214/dart_sdk.js:35438:29)
at handleValueCallback (http://localhost:59214/dart_sdk.js:35999:49)
at _Future._propagateToListeners (http://localhost:59214/dart_sdk.js:36037:17)
at [_completeWithValue] (http://localhost:59214/dart_sdk.js:35872:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:59214/dart_sdk.js:35906:35)
at Object._microtaskLoop (http://localhost:59214/dart_sdk.js:40778:13)
at _startMicrotaskLoop (http://localhost:59214/dart_sdk.js:40784:13)
at http://localhost:59214/dart_sdk.js:36261:9"

Related

Getting errors after install linux when i tried to open my vue 3 project

whenever i try to open any of my vue 3 project. I tried npm i autoprefixer but didn't work , then i tried deleting packagelock.json and node modules also it's not working, below are the errors I receive :
Compiled with problems:X
ERROR in ./src/router/index.js 4:0-51
Module not found: Error: Can't resolve '../views/AccountView.vue' in 'D:\project\Church\src\router'
ERROR in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=css (./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-cli-plugin-quasar/lib/loader.vue.auto-import-quasar.js??ruleSet[0].use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[1]!./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=css)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
Error: Cannot find module 'autoprefixer'
Require stack:
D:\project.postcssrc.js
D:\project\Church\node_modules\cosmiconfig\dist\loaders.js
D:\project\Church\node_modules\cosmiconfig\dist\ExplorerBase.js
D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js
D:\project\Church\node_modules\cosmiconfig\dist\index.js
D:\project\Church\node_modules\postcss-loader\dist\utils.js
D:\project\Church\node_modules\postcss-loader\dist\index.js
D:\project\Church\node_modules\postcss-loader\dist\cjs.js
D:\project\Church\node_modules\webpack\lib\ProgressPlugin.js
D:\project\Church\node_modules\progress-webpack-plugin\index.js
D:\project\Church\node_modules#vue\cli-service\lib\commands\serve.js
D:\project\Church\node_modules#vue\cli-service\lib\Service.js
D:\project\Church\node_modules#vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (D:\project.postcssrc.js:2:3)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at module.exports (D:\project\Church\node_modules\import-fresh\index.js:32:59)
at loadJs (D:\project\Church\node_modules\cosmiconfig\dist\loaders.js:16:18)
at Explorer.loadFileContent (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:84:32)
at Explorer.createCosmiconfigResult (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:89:36)
at Explorer.loadSearchPlace (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:70:31)
at async Explorer.searchDirectory (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:55:27)
at async run (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:35:22)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async Explorer.search (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:27:20)
at async loadConfig (D:\project\Church\node_modules\postcss-loader\dist\utils.js:68:16)
at async Object.loader (D:\project\Church\node_modules\postcss-loader\dist\index.js:54:22)
ERROR in ./node_modules/#quasar/extras/material-icons/material-icons.css (./node_modules/css-loader/dist/cjs.js??clonedRuleSet-14.use[1]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-14.use[2]!./node_modules/#quasar/extras/material-icons/material-icons.css)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
Error: Cannot find module 'autoprefixer'
Require stack:
D:\project.postcssrc.js
D:\project\Church\node_modules\cosmiconfig\dist\loaders.js
D:\project\Church\node_modules\cosmiconfig\dist\ExplorerBase.js
D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js
D:\project\Church\node_modules\cosmiconfig\dist\index.js
D:\project\Church\node_modules\postcss-loader\dist\utils.js
D:\project\Church\node_modules\postcss-loader\dist\index.js
D:\project\Church\node_modules\postcss-loader\dist\cjs.js
D:\project\Church\node_modules\webpack\lib\ProgressPlugin.js
D:\project\Church\node_modules\progress-webpack-plugin\index.js
D:\project\Church\node_modules#vue\cli-service\lib\commands\serve.js
D:\project\Church\node_modules#vue\cli-service\lib\Service.js
D:\project\Church\node_modules#vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (D:\project.postcssrc.js:2:3)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at module.exports (D:\project\Church\node_modules\import-fresh\index.js:32:59)
at loadJs (D:\project\Church\node_modules\cosmiconfig\dist\loaders.js:16:18)
at Explorer.loadFileContent (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:84:32)
at Explorer.createCosmiconfigResult (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:89:36)
at Explorer.loadSearchPlace (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:70:31)
at async Explorer.searchDirectory (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:55:27)
at async run (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:35:22)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async Explorer.search (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:27:20)
at async loadConfig (D:\project\Church\node_modules\postcss-loader\dist\utils.js:68:16)
at async Object.loader (D:\project\Church\node_modules\postcss-loader\dist\index.js:54:22)
ERROR in ./src/styles/quasar.scss (./node_modules/css-loader/dist/cjs.js??clonedRuleSet-24.use[1]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-24.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-24.use[3]!./node_modules/vue-cli-plugin-quasar/lib/loader.scss.js!./src/styles/quasar.scss)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
Error: Cannot find module 'autoprefixer'
Require stack:
D:\project.postcssrc.js
D:\project\Church\node_modules\cosmiconfig\dist\loaders.js
D:\project\Church\node_modules\cosmiconfig\dist\ExplorerBase.js
D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js
D:\project\Church\node_modules\cosmiconfig\dist\index.js
D:\project\Church\node_modules\postcss-loader\dist\utils.js
D:\project\Church\node_modules\postcss-loader\dist\index.js
D:\project\Church\node_modules\postcss-loader\dist\cjs.js
D:\project\Church\node_modules\webpack\lib\ProgressPlugin.js
D:\project\Church\node_modules\progress-webpack-plugin\index.js
D:\project\Church\node_modules#vue\cli-service\lib\commands\serve.js
D:\project\Church\node_modules#vue\cli-service\lib\Service.js
D:\project\Church\node_modules#vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (D:\project.postcssrc.js:2:3)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at module.exports (D:\project\Church\node_modules\import-fresh\index.js:32:59)
at loadJs (D:\project\Church\node_modules\cosmiconfig\dist\loaders.js:16:18)
at Explorer.loadFileContent (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:84:32)
at Explorer.createCosmiconfigResult (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:89:36)
at Explorer.loadSearchPlace (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:70:31)
at async Explorer.searchDirectory (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:55:27)
at async run (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:35:22)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async cacheWrapper (D:\project\Church\node_modules\cosmiconfig\dist\cacheWrapper.js:16:18)
at async Explorer.search (D:\project\Church\node_modules\cosmiconfig\dist\Explorer.js:27:20)
at async loadConfig (D:\project\Church\node_modules\postcss-loader\dist\utils.js:68:16)
at async Object.loader (D:\project\Church\node_modules\postcss-loader\dist\index.js:54:22)
You should run npm install -D autoprefixer and then make sure that the file src/router/views/AccountView.vue does exist. IF it does not exist there - you must update the pathname in src/router/index.js

vercel nextjs deployment build error: How to debug?

I'm a beginner deploying a basic nextjs app with vercel.
This error is occurring in the node_modules files, not in any code that I have written.
How should I go about debugging this?
TypeError: Cannot read properties of undefined (reading 'page')
at /vercel/path0/node_modules/next/dist/export/index.js:223:40
at Array.filter (<anonymous>)
at /vercel/path0/node_modules/next/dist/export/index.js:222:43
at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
at async /vercel/path0/node_modules/next/dist/build/index.js:1168:21
at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
at async /vercel/path0/node_modules/next/dist/build/index.js:1044:17
at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
at async Object.build [as default] (/vercel/path0/node_modules/next/dist/build/index.js:65:29)```

Clean install of Strapi/Next.js starter throws errors on preview mode

I am running a clean install of the strapi-starter-next-corporate starter app. When I try to access a preview of the unpublished "secret" page, I get this error:
[develop:frontend] error - ReferenceError: locale is not defined
[develop:frontend] at preview (C:\Users\username\Projects\projectname\frontend\.next\server\pages\api
\preview.js:36:5)
[develop:frontend] at Object.apiResolver (C:\Users\username\Projects\projectname\frontend\node_module
s\next\dist\server\api-utils.js:101:15)
[develop:frontend] at runMicrotasks (<anonymous>)
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[develop:frontend] at async DevServer.handleApiRequest (C:\Users\username\Projects\projectname\fronte
nd\node_modules\next\dist\server\next-server.js:775:9)
[develop:frontend] at async Object.fn (C:\Users\username\Projects\projectname\frontend\node_modules\n
ext\dist\server\next-server.js:666:37)
[develop:frontend] at async Router.execute (C:\Users\username\Projects\projectname\frontend\node_modu
les\next\dist\server\router.js:205:32)
[develop:frontend] at async DevServer.run (C:\Users\username\Projects\projectname\frontend\node_modul
es\next\dist\server\next-server.js:846:29)
[develop:frontend] at async DevServer.run (C:\Users\username\Projects\projectname\frontend\node_modul
es\next\dist\server\dev\next-dev-server.js:355:20)
[develop:frontend] at async DevServer.handleRequest (C:\Users\username\Projects\projectname\frontend\
node_modules\next\dist\server\next-server.js:292:20) {
[develop:frontend] page: '/api/preview'
[develop:frontend] }
[develop:backend ] [2022-02-09 09:48:13.162] http: POST /graphql (9 ms) 400
[develop:frontend] TypeError: Cannot read property 'global' of undefined
[develop:frontend] at getGlobalData (C:\Users\username\Projects\projectname\frontend\.next\server\pag
es\_app.js:628:22)
[develop:frontend] at runMicrotasks (<anonymous>)
[develop:frontend] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[develop:frontend] at async Function.MyApp.getInitialProps (C:\Users\username\Projects\projectname\fr
ontend\.next\server\pages\_app.js:249:24)
[develop:frontend] at async Object.loadGetInitialProps (C:\Users\username\Projects\projectname\fronte
nd\node_modules\next\dist\shared\lib\utils.js:69:19)
[develop:frontend] at async Object.renderToHTML (C:\Users\username\Projects\projectname\frontend\node
_modules\next\dist\server\render.js:314:17)
[develop:frontend] at async doRender (C:\Users\username\Projects\projectname\frontend\node_modules\ne
xt\dist\server\next-server.js:1149:38)
[develop:frontend] at async C:\Users\username\Projects\projectname\frontend\node_modules\next\dist\se
rver\next-server.js:1241:28
[develop:frontend] at async C:\Users\username\Projects\projectname\frontend\node_modules\next\dist\se
rver\response-cache.js:64:36
My preview url:
http://localhost:3000/api/preview?secret=xxxxxxxxxxxxxxxxx&slug=secret
I also tried:
http://localhost:3000/api/preview?secret=xxxxxxxxxxxxxxxxx&slug=/secret
My .env file for my next app:
NEXT_PUBLIC_STRAPI_API_URL=http://localhost:1337
PREVIEW_SECRET=xxxxxxxxxxxxxxxxx
My .env file for my strapi app:
FRONTEND_URL=http://localhost:3000
FRONTEND_PREVIEW_SECRET=xxxxxxxxxxxxxxxxx
The I18 plugin and the preview code seem not to be totally integrated. Has anyone else encountered this?
Windows 11
Node.js v14.18.3
I think that you found a bug. The reason is that strapi-starter-next-corporate uses locale inside API route /frontend/pages/api/preview.js. Next.js does not support locale inside API route. You can read more about it here.

Flutter and Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app)

I've set up firebase with Flutter for iOS and Android.
When running flutter run I'm getting the error with the following error:
FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp()
(app/no-app).
at Object.f [as app] (https://www.gstatic.com/firebasejs/7.20.0/firebase-app.js:1:17054)
at Object.app$ [as app]
(http://localhost:50861/packages/firebase_core_web/src/interop/core.dart.lib.js:42:101)
at initializeApp
(http://localhost:50861/packages/firebase_core_web/firebase_core_web.dart.lib.js:101:25)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:50861/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:50861/dart_sdk.js:39083:7)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp
(http://localhost:50861/packages/firebase_core_web/firebase_core_web.dart.lib.js:94:20)
at initializeApp (http://localhost:50861/packages/firebase_core/firebase_core.dart.lib.js:117:59)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:50861/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:50861/dart_sdk.js:39083:7)
at Function.initializeApp
(http://localhost:50861/packages/firebase_core/firebase_core.dart.lib.js:116:20)
at main$ (http://localhost:50861/packages/scbeta/main.dart.lib.js:477:36)
at main$.next (<anonymous>)
at runBody (http://localhost:50861/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:50861/dart_sdk.js:39083:7)
at main$ (http://localhost:50861/packages/scbeta/main.dart.lib.js:475:18)
at main (http://localhost:50861/web_entrypoint.dart.lib.js:49:29)
at main.next (<anonymous>)
at http://localhost:50861/dart_sdk.js:39032:33
at _RootZone.runUnary (http://localhost:50861/dart_sdk.js:38889:58)
at _FutureListener.thenAwait.handleValue (http://localhost:50861/dart_sdk.js:33875:29)
at handleValueCallback (http://localhost:50861/dart_sdk.js:34435:49)
at Function._propagateToListeners (http://localhost:50861/dart_sdk.js:34473:17)
at _Future.new.[_completeWithValue] (http://localhost:50861/dart_sdk.js:34315:23)
at http://localhost:50861/dart_sdk.js:33526:46
at _RootZone.runUnary (http://localhost:50861/dart_sdk.js:38889:58)
at _FutureListener.then.handleValue (http://localhost:50861/dart_sdk.js:33875:29)
at handleValueCallback (http://localhost:50861/dart_sdk.js:34435:49)
at Function._propagateToListeners (http://localhost:50861/dart_sdk.js:34473:17)
at _Future.new.[_completeWithValue] (http://localhost:50861/dart_sdk.js:34315:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:50861/dart_sdk.js:34338:35)
at Object._microtaskLoop (http://localhost:50861/dart_sdk.js:39176:13)
at _startMicrotaskLoop (http://localhost:50861/dart_sdk.js:39182:13)
at http://localhost:50861/dart_sdk.js:34689:9
The main function in my main.dart looks like this:
Future<void> main() async {
// Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
I haven't made any firebase calls or initialisations anywhere else in the app.
In my pubspec.yaml I only have firebase_core: ^1.0.1 as a dependency
I have looked at several questions on StackOverflow of people who've had similar problems but none of the solutions where of any help to me.
Have you already created firebase app and configure it for your flutter app?
I've solved it.
The problem was, that with Flutter 2 which just came out a few days ago, you have to add web as a platform as well which none of the tutorials or solutions I've seen mentioned. Once I've added Web on firebase and the scripts in flutter it worked just fine.

E/MethodChannel#plugins.flutter.io/firebase_database( 6299): Failed to handle method call

I am trying to add a simple text to the Firebase database. I have successfully logged in using gmail and that worked properly, but when i try to add anything it gives me this error:
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call.
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database##17.0.0:103)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database##17.0.0:60)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at io.flutter.plugins.firebase.database.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:236)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#plugins.flutter.io/firebase_database( 6299): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/flutter ( 6299): lets gooo00000000000
E/flutter ( 6299): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(error, Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call., null, com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call.
E/flutter ( 6299): at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database##17.0.0:103)
E/flutter ( 6299): at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database##17.0.0:60)
E/flutter ( 6299): at io.flutter.plugins.firebase.database.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:236)
E/flutter ( 6299): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter ( 6299): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter ( 6299): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/flutter ( 6299): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 6299): at android.os.MessageQueue.next(MessageQueue.java:326)
E/flutter ( 6299): at android.os.Looper.loop(Looper.java:160)
E/flutter ( 6299): at android.app.ActivityThread.main(ActivityThread.java:6669)
The code:
final databaser= FirebaseDatabase.instance.reference();
savePost(){
databaser.child('cats').set({
'id':'1',
'name': 'yes sirr'
}
);
print("lets gooo00000000000");
}
no caption
the error that gave me a headache
See the example https://pub.dev/packages/firebase_database/example
I think you have to initialise with await Firebase.initializeApp(...)
As spkersten said in their answer, make sure that you call Firebase.initializeApp(...) before getting the database instance.
If you've done that and still get the answer, it may be that the database URL is missing from the Google-Services.json that you downloaded from the Firebase console. If that is the cause, you can solve it by downloading an updated Google-Services.json after making sure the database has been created in the console, and adding it to your app as you did before.
For more on this, see:
Firebase : I get in trouble when I sign in with Google (for Android)
where to provide NSURL value? (for iOS)

Resources