Uncaught SyntaxError: ambiguous indirect export: default vuejs 3 in vuex - vue.js
main.js
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import Vue from 'vue';
import PrimeVue from 'primevue/config';
import AutoComplete from 'primevue/autocomplete';
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
import Avatar from 'primevue/avatar';
import AvatarGroup from 'primevue/avatargroup';
import Badge from 'primevue/badge';
import BadgeDirective from 'primevue/badgedirective';
import BlockUI from 'primevue/blockui';
import Button from 'primevue/button';
import Breadcrumb from 'primevue/breadcrumb';
import Calendar from 'primevue/calendar';
import Card from 'primevue/card';
import Chart from 'primevue/chart';
import CascadeSelect from 'primevue/cascadeselect';
import Carousel from 'primevue/carousel';
import Checkbox from 'primevue/checkbox';
import Chip from 'primevue/chip';
import Chips from 'primevue/chips';
import ColorPicker from 'primevue/colorpicker';
import Column from 'primevue/column';
import ColumnGroup from 'primevue/columngroup';
import ConfirmDialog from 'primevue/confirmdialog';
import ConfirmPopup from 'primevue/confirmpopup';
import ConfirmationService from 'primevue/confirmationservice';
import ContextMenu from 'primevue/contextmenu';
import DataTable from 'primevue/datatable';
import DataView from 'primevue/dataview';
import DataViewLayoutOptions from 'primevue/dataviewlayoutoptions';
import DeferredContent from 'primevue/deferredcontent';
import Dialog from 'primevue/dialog';
import DialogService from 'primevue/dialogservice';
import Divider from 'primevue/divider';
import Dock from 'primevue/dock';
import Dropdown from 'primevue/dropdown';
import DynamicDialog from 'primevue/dynamicdialog';
import Fieldset from 'primevue/fieldset';
import FileUpload from 'primevue/fileupload';
import Galleria from 'primevue/galleria';
import Image from 'primevue/image';
import InlineMessage from 'primevue/inlinemessage';
import Inplace from 'primevue/inplace';
import InputSwitch from 'primevue/inputswitch';
import InputText from 'primevue/inputtext';
import InputMask from 'primevue/inputmask';
import InputNumber from 'primevue/inputnumber';
import Knob from 'primevue/knob';
import Listbox from 'primevue/listbox';
import MegaMenu from 'primevue/megamenu';
import Menu from 'primevue/menu';
import Menubar from 'primevue/menubar';
import Message from 'primevue/message';
import MultiSelect from 'primevue/multiselect';
import OrderList from 'primevue/orderlist';
import OrganizationChart from 'primevue/organizationchart';
import OverlayPanel from 'primevue/overlaypanel';
import Paginator from 'primevue/paginator';
import Panel from 'primevue/panel';
import PanelMenu from 'primevue/panelmenu';
import Password from 'primevue/password';
import PickList from 'primevue/picklist';
import ProgressBar from 'primevue/progressbar';
import ProgressSpinner from 'primevue/progressspinner';
import Rating from 'primevue/rating';
import RadioButton from 'primevue/radiobutton';
import Ripple from 'primevue/ripple';
import Row from 'primevue/row';
import SelectButton from 'primevue/selectbutton';
import ScrollPanel from 'primevue/scrollpanel';
import ScrollTop from 'primevue/scrolltop';
import Skeleton from 'primevue/skeleton';
import Slider from 'primevue/slider';
import Sidebar from 'primevue/sidebar';
import SpeedDial from 'primevue/speeddial';
import SplitButton from 'primevue/splitbutton';
import Splitter from 'primevue/splitter';
import SplitterPanel from 'primevue/splitterpanel';
import Steps from 'primevue/steps';
import StyleClass from 'primevue/styleclass';
import TabMenu from 'primevue/tabmenu';
import TieredMenu from 'primevue/tieredmenu';
import Textarea from 'primevue/textarea';
import Toast from 'primevue/toast';
import ToastService from 'primevue/toastservice';
import Toolbar from 'primevue/toolbar';
import TabView from 'primevue/tabview';
import TabPanel from 'primevue/tabpanel';
import Tag from 'primevue/tag';
import Terminal from 'primevue/terminal';
import Timeline from 'primevue/timeline';
import ToggleButton from 'primevue/togglebutton';
import Tooltip from 'primevue/tooltip';
import Tree from 'primevue/tree';
import TreeSelect from 'primevue/treeselect';
import TreeTable from 'primevue/treetable';
import TriStateCheckbox from 'primevue/tristatecheckbox';
import VirtualScroller from 'primevue/virtualscroller';
import CodeHighlight from '#/components/CodeHighlight.vue';
import BlockViewer from '#/components/BlockViewer.vue';
import '#/assets/styles.scss';
const app = createApp(App);
app.use(router);
app.use(PrimeVue, { ripple: true });
app.use(ToastService);
app.use(DialogService);
app.use(ConfirmationService);
app.directive('tooltip', Tooltip);
app.directive('badge', BadgeDirective);
app.directive('ripple', Ripple);
app.directive('styleclass', StyleClass);
app.component('CodeHighlight', CodeHighlight);
app.component('BlockViewer', BlockViewer);
app.component('Accordion', Accordion);
app.component('AccordionTab', AccordionTab);
app.component('AutoComplete', AutoComplete);
app.component('Avatar', Avatar);
app.component('AvatarGroup', AvatarGroup);
app.component('Badge', Badge);
app.component('BlockUI', BlockUI);
app.component('Breadcrumb', Breadcrumb);
app.component('Button', Button);
app.component('Calendar', Calendar);
app.component('Card', Card);
app.component('Chart', Chart);
app.component('Carousel', Carousel);
app.component('CascadeSelect', CascadeSelect);
app.component('Checkbox', Checkbox);
app.component('Chip', Chip);
app.component('Chips', Chips);
app.component('ColorPicker', ColorPicker);
app.component('Column', Column);
app.component('ColumnGroup', ColumnGroup);
app.component('ConfirmDialog', ConfirmDialog);
app.component('ConfirmPopup', ConfirmPopup);
app.component('ContextMenu', ContextMenu);
app.component('DataTable', DataTable);
app.component('DataView', DataView);
app.component('DataViewLayoutOptions', DataViewLayoutOptions);
app.component('DeferredContent', DeferredContent);
app.component('Dialog', Dialog);
app.component('Divider', Divider);
app.component('Dock', Dock);
app.component('Dropdown', Dropdown);
app.component('DynamicDialog', DynamicDialog);
app.component('Fieldset', Fieldset);
app.component('FileUpload', FileUpload);
app.component('Galleria', Galleria);
app.component('Image', Image);
app.component('InlineMessage', InlineMessage);
app.component('Inplace', Inplace);
app.component('InputMask', InputMask);
app.component('InputNumber', InputNumber);
app.component('InputSwitch', InputSwitch);
app.component('InputText', InputText);
app.component('Knob', Knob);
app.component('Listbox', Listbox);
app.component('MegaMenu', MegaMenu);
app.component('Menu', Menu);
app.component('Menubar', Menubar);
app.component('Message', Message);
app.component('MultiSelect', MultiSelect);
app.component('OrderList', OrderList);
app.component('OrganizationChart', OrganizationChart);
app.component('OverlayPanel', OverlayPanel);
app.component('Paginator', Paginator);
app.component('Panel', Panel);
app.component('PanelMenu', PanelMenu);
app.component('Password', Password);
app.component('PickList', PickList);
app.component('ProgressBar', ProgressBar);
app.component('ProgressSpinner', ProgressSpinner);
app.component('RadioButton', RadioButton);
app.component('Rating', Rating);
app.component('Row', Row);
app.component('SelectButton', SelectButton);
app.component('ScrollPanel', ScrollPanel);
app.component('ScrollTop', ScrollTop);
app.component('Slider', Slider);
app.component('Sidebar', Sidebar);
app.component('Skeleton', Skeleton);
app.component('SpeedDial', SpeedDial);
app.component('SplitButton', SplitButton);
app.component('Splitter', Splitter);
app.component('SplitterPanel', SplitterPanel);
app.component('Steps', Steps);
app.component('TabMenu', TabMenu);
app.component('TabView', TabView);
app.component('TabPanel', TabPanel);
app.component('Tag', Tag);
app.component('Textarea', Textarea);
app.component('Terminal', Terminal);
app.component('TieredMenu', TieredMenu);
app.component('Timeline', Timeline);
app.component('Toast', Toast);
app.component('Toolbar', Toolbar);
app.component('ToggleButton', ToggleButton);
app.component('Tree', Tree);
app.component('TreeSelect', TreeSelect);
app.component('TreeTable', TreeTable);
app.component('TriStateCheckbox', TriStateCheckbox);
app.component('VirtualScroller', VirtualScroller);
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
}).mount('#app');
auth.js
import firebase from 'firebase'
import firebaseui from 'firebaseui';
const config = {
apiKey: "AIzaSyBfEKjNqtQRdeRxd1ocNwAQjPMo80MUn70",
authDomain: "qrpay-23f88.firebaseapp.com",
databaseURL: "https://qrpay-23f88.firebaseio.com",
projectId: "qrpay-23f88",
storageBucket: "qrpay-23f88.appspot.com",
messagingSenderId: "651606142877"
};
const auth = {
context: null,
uiConfig: null,
ui: null,
init(context) {
this.context = context;
firebase.initializeApp(config);
this.uiConfig = {
signInSuccessUrl: 'dashboard',
signInOptions: [
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID
]
}
this.ui = new firebaseui.auth.AuthUI(firebase.auth());
firebase.auth().onAuthStateChanged((user) => {
this.context.$store.dispatch('user/setCurrentUser')
let requireAuth = this.context.$route.matched.some(record => record.meta.requireAuth)
let guestOnly = this.context.$route.matched.some(record => record.meta.guestOnly)
if(requireAuth && !user) this.context.$router.push('auth')
else if (guestOnly && user) this.context.$router.push('dashboard')
});
},
authForm(container) {
this.ui.start(container, this.uiConfig);
},
user() {
return this.context ? firebase.auth().currentUser : null;
},
logout() {
firebase.auth().signOut();
}
}
export default auth;
here i trying to Firebase google authentication but i get error Uncaught SyntaxError: ambiguous indirect export: default to blank page how to solve this problem.
here i trying to Firebase google authentication but i get error Uncaught SyntaxError: ambiguous indirect export: default to blank page how to solve this problem.here i trying to Firebase google authentication but i get error Uncaught SyntaxError: ambiguous indirect export: default to blank page how to solve this problem.here i trying to Firebase google authentication but i get error Uncaught SyntaxError: ambiguous indirect export: default to blank page how to solve this problem.
Related
How to use Realm SDK with vue3
i have use realm sdk in vue2 with this syntax // file scr/plugins/realm.js import Vue from 'vue'; import {App} from 'realm-web'; Vue.prototype.realmApp = new App({id: 'artes-realm-vl12'}) //file scr/main.js import './plugins/realm'; but in Vue3 this syntax is't working anymore can you please help me how to solve with this problem thank you
In main.js add that app as global property : import {createApp} from 'vue' import {App} from 'realm-web'; import app from './App.vue' const myApp=createApp(app) myApp.config.globalProperties.realmApp = new App({id: 'artes-realm-vl12'}) myApp.mount('#app');
TypeError: this.Vue.axios is undefined when using axios HTTP driver
Using vue-auth (vue-auth on GitHub) with the Axios HTTP driver I get the following error in the browser console: TypeError: this.Vue.axios is undefined main.js import Vue from "vue"; import App from "./App.vue"; import axios from "axios"; import "./libs/vue-auth"; ./libs/vue-auth.js import Vue from "vue"; import vueAuth from "#websanova/vue-auth"; import bearer from "#websanova/vue-auth/drivers/auth/bearer"; import axiosHttp from "#websanova/vue-auth/drivers/http/axios.1.x"; import vueRouter from "#websanova/vue-auth/drivers/router/vue-router.2.x"; // Vue.axios = axios; Vue.use(vueAuth, { auth: bearer, http: axiosHttp, router: vueRouter // ... }); When removing the comment for Vue.axios = axios; it seems to work at first glance. So I thought moving Vue.axios = axios; to the main.js but then again it's not working.
Vue.axios can be assigned either manually or with vue-axios plugin. Since #websanova/vue-auth/drivers/http/axios.1.x expects it to exist on plugin initialization: import Vue from 'vue' import axios from 'axios' import VueAxios from 'vue-axios' ... Vue.use(VueAxios, axios) Vue.use(vueAuth, ...) Moving Vue.use(VueAxios, axios) to main.js won't work because it should be evaluated before ./libs/vue-auth is imported, and it cannot precede import according to JS specs. Vue.use(...) should either moved to main.js together, or they both should be located in ./lib modules.
Use multiple plugins with parameters in VueJS
Let say I have 2 plugins I want to use: Bootstrap-Vue & Vue Analytics I would import like so import BootstrapVue from 'bootstrap-vue' import VueAnalytics from 'vue-analytics' How would I use them if one has parameters? Is this correct? Vue.use(BootstrapVue, VueAnalytics, { id: 'UA-12345678-9' });
Don't overthink it. Just call Vue.use twice. Vue.use(BootstrapVue); Vue.use(VueAnalytics, { id: 'UA-12345678-9' });
import BootstrapVue from 'bootstrap-vue' import VueAnalytics from 'vue-analytics' [BootstrapVue, VueAnalytics].forEach((x) => Vue.use(x)); This is what I usually use.
I will use: const useArray = [Bootstrap-Vue, Vue Analytics]; useArray.forEach((item)=>{ Vue.use(item) })
The application does not work after the deploy?
When I try to use the vue-custom-component, I get an error on the vue-router import Vue from 'vue' import vueCustomElement from 'vue-custom-element'; import App from './App.vue' import router from './router' import store from './store' import Element from 'element-ui' import elementLocale from 'element-ui/lib/locale/lang/ru-RU' import VueFullPage from 'vue-fullpage.js' import Testing from '#/components/Testing.vue' Vue.config.ignoredElements = [ 'example-component' ]; // Enable the plugin Vue.use(vueCustomElement); // Register your component Vue.customElement('example-component', Testing, { // Additional Options: https://github.com/karol-f/vue-custom-element#options }); Vue.use(Element, { locale: elementLocale }); Vue.use(VueFullPage); Vue.config.productionTip = false new Vue({ router, store, render: h => h(App) }).$mount('#app') import 'element-ui/lib/theme-chalk/index.css'; import './assets/css/fonts.scss'; import './assets/css/main.scss'; import 'animate.css'; <!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>testing_baziron_vorobjev</title><link href=./css/app.1fe0df1e.css rel=preload as=style><link href=./css/chunk-vendors.9205998e.css rel=preload as=style><link href=./js/app.10a7c671.js rel=preload as=script><link href=./js/chunk-vendors.9cb8b2ec.js rel=preload as=script><link href=./css/chunk-vendors.9205998e.css rel=stylesheet><link href=./css/app.1fe0df1e.css rel=stylesheet></head><body><noscript><strong>We're sorry but testing doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><example-component></example-component><script src="https://unpkg.com/vue"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/document-register-element/1.4.1/document-register-element.js"></script><script src=./js/chunk-vendors.9cb8b2ec.js></script><script src=./js/app.10a7c671.js></script></body></html> I used the vue-cli3. Made a small application; I did everything on instructions; After the command NPM rub build jump errors The application itself is being downloaded. But errors appear. And if I corrected the picture errors, then the first one I can not fix
Requiring unknown module “http” when using redux-dev-tools
This is my code snippet below : import { createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import devTools from 'remote-redux-devtools'; import StockApp from '../reducers'; // create a store that has redux-thunk middleware enabled const createStoreWithMiddleware = applyMiddleware( thunk )(createStore); alert("inside production"); export default function configureStore() { return createStoreWithMiddleware(StockApp); } Whenever i try to import remote-redux-devtools it gives me below screen in case i try to remove remote-redux-devtools import statement everything goes well , please suggest or point out what can be cause when i specify redux dev tool in
as the picture,you should ctrl+c end the server, and re-start, npm run start --reset-cache