Use Xcode9, Swift4 no work on real Iphone6
Two issues:
Redefinition of Module 'Firebase'
No such module 'UserNotifications'
but if I use Simulator all is good!
install firebase pod and import following modules
import Firebase
import FirebaseMessaging
import UserNotifications
Related
I'm new Vue, I don't understand this error from installing bootstrap-vue-3
Install commands:
npm i --save bootstrap bootstrap-vue-3
Configuration [main.js]:
import { createApp } from 'vue'
import App from './App.vue'
import './index.css'
import BootstrapVue3 from 'bootstrap-vue-3'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue-3/dist/bootstrap-vue-3.css'
createApp(App)
.use(BootstrapVue3)
.mount('#app')
Errors:
Rollup failed to resolve import "bootstrap/js/dist/carousel" from "node_modules/bootstrap-vue-3/dist/bootstrap-vue-3.es.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to rollupInputOptions.external
This is a new project -- nothing added aside from default stuff and bootstrap.
image of the project and files
I am trying to import firebase in my react app, using the following syntax:
import firebase from "firebase";
But I am facing following issue:
./src/firebase.js
Module not found: Can't resolve 'firebase' in '/Users/Desktop/reels/src'
commands i have ran on terminal:
npm i firebase
Also i have checked in the node modules firebase was there.
You should try this code
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";
I think you're using the ^9 version, so try this:
import firebase from 'firebase/compat/app'
I want to import the firebase-database using esm import. I can only find the script version:
<script src="https://www.gstatic.com/firebasejs/7.21.0/firebase-database.js"></script>
What is the url I need for the esm module version?
Note: I do not want a "bare import", I am not using webpack etc. I need a complete url.
There is an older version available on unpkg.com but not the current version.
It turns out there are two CDN's that can provide this: snowpack/skypack, and jspm:
skypack:
import firebase from 'https://cdn.skypack.dev/#firebase/app'
import 'https://cdn.skypack.dev/#firebase/database'
jspm:
import { firebase } from 'https://jspm.dev/#firebase/app'
import 'https://jspm.dev/#firebase/database'
These both deal with "bare import" conversion to JS, and any code conversions required to be JS Modules.
Google does not appear to want to support a module form on their firebase CDN, an Issue to that effect was immediately closed, suggesting complex workflow solutions.
I'm really thankful to the two projects above, supporting simple es6 JS and zero workflow solutions.
Edit: snowpack's esinstall can turn most js files into modules. Here's a node script that brought in all my dependencies:
#!/usr/bin/env node --require esm
import { install } from 'esinstall'
import nodePolyfills from 'rollup-plugin-node-polyfills'
async function run() {
const foo = await install(
[
'mapbox-gl',
'three',
'three/examples/jsm/controls/OrbitControls.js',
'three/src/core/Object3D.js',
'chart.js',
'dat.gui',
'fflate',
'#turf/turf',
'stats.js',
'#firebase/app',
'#firebase/database',
],
{
rollup: {
plugins: [nodePolyfills()],
},
}
)
}
run()
If you're using a bundler, then follow the instructions in the documentation:
Install the firebase npm package and save it to your package.json file
by running:
npm install --save firebase
To include only specific Firebase products (like Authentication and
Cloud Firestore), import Firebase modules:
// Firebase App (the core Firebase SDK) is always required and must be listed first
import * as firebase from "firebase/app";
// If you enabled Analytics in your project, add the Firebase SDK for Analytics
import "firebase/analytics";
// Add the Firebase products that you want to use
import "firebase/auth";
import "firebase/firestore";
For realtime database, you would add import "firebase/database".
I have installed firebase package in my project using cmd
npm install --save firebase
When I import firebase to my react-native project import firebase from 'firebase' I'm getting this error. What could be the problem?
Follow this pattern the error will be resolved the issue is due to upgradation in Firebase repo:
import React, {Component} from 'react';
import {Text, View} from 'react-native';
// import firebase from 'firebase';
import firebase from '#firebase/app'
import { Header } from './Components/Common';
Ran into Same issue i solved it by installing babel polyfill
npm i --save-dev babel-polyfill
then in my index.js:
import 'babel-polyfill';
thats because of the recent version of firebase you can roll back to version 4 or you can import like
import firebase from '#firebase/app';
any of the above two approaches will solve your problem
I have followed the tutorial at https://www.djamware.com/post/5a629d9880aca7059c142976/build-ionic-3-angular-5-and-firebase-simple-chat-app to build an Ionic app using Firebase's realtime database.
It works perfectly locally via ionic serve. I have also used the Ionic DevApp and again, it works perfectly.
I have now pushed my code to Ionic but during the build I get this error and the build process terminates:
[11:20:31] typescript: src/pages/chat/chat.ts, line: 7
Cannot find module 'Firebase'.
L7: import * as firebase from 'Firebase';
Error: Failed to transpile program
at new BuildError (/usr/src/app/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:159:20
at Promise ()
at transpileWorker (/usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:107:12)
at Object.transpile (/usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:64:12)
at /usr/src/app/node_modules/#ionic/app-scripts/dist/build.js:109:82
at
npm info lifecycle fanslide#0.0.1~build: Failed to exec build script
In chat.ts I have:
import * as firebase from 'Firebase';
Inside package.json I can see:
"firebase": "^4.8.0",
I am not sure what I have done wrong and why this works locally but not when the build takes place on Ionic's server.
I managed to overcome this issue and successfully complete a build in Ionic by changing:
import * as firebase from 'Firebase';
To:
import firebase from 'firebase';