1

I have strange error, i don’t know what causing this but last time i develop my project was fine. After no reason my chrome browser lost its cache data (next day). when i run my vue3 project the error appears. What console logs said

App.vue?3dfd:11 Uncaught TypeError: Object(...) is not a function
    at eval (App.vue?3dfd:11)
    at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js?!./src/App.vue?vue&type=template&id=7ba5bd90 

img1

And that pointing to something right before

img2

This is my main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Notifications from 'vue3-vt-notifications'
import { store } from './stores'
import Particles from 'particles.vue3'

// import tailwind css
import '../src/styles.css'

// firebase auth service
import { projectAuth } from './firebase/config'

let app
projectAuth.onAuthStateChanged(() => {
    if(!app){
        app = createApp(App)
        .use(router)
        .use(store)
        .use(Particles)
        .use(VueAxios, axios)
        .use(Notifications)
        .mount('#app')
    }
})

and this is my package.json

{
  "name": "myproject",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "build-css": "tailwindcss build src/styles.css -o public/styles.css"
  },
  "dependencies": {
    "@dafcoe/vue-collapsible-panel": "^0.2.0",
    "@tailwindcss/postcss7-compat": "^2.0.2",
    "@tinymce/tinymce-vue": "^4.0.0",
    "algoliasearch": "^4.10.5",
    "autoprefixer": "^9.8.6",
    "axios": "^0.21.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "core-js": "^3.6.5",
    "d3": "^7.0.0",
    "d3-svg-legend": "^2.25.6",
    "d3-v6-tip": "^1.0.9",
    "date-fns": "^2.16.1",
    "es6-promise": "^4.2.8",
    "firebase": "^8.2.1",
    "firebase-admin": "^9.4.2",
    "firebase-functions": "^3.13.1",
    "firebaseui": "^4.7.1",
    "js-md5": "^0.7.3",
    "jspdf": "^2.3.1",
    "node-sass": "^5.0.0",
    "particles.vue3": "^1.12.2",
    "postcss": "^7.0.35",
    "sass-loader": "^11.0.1",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
    "vue": "^3.0.0",
    "vue-axios": "^3.2.4",
    "vue-clipboard3": "^1.0.0",
    "vue-disqus": "^5.1.0",
    "vue-dropdowns": "^1.1.2",
    "vue-google-signin-button": "^1.0.4",
    "vue-instantsearch": "^4.0.0",
    "vue-load-image": "^1.1.0",
    "vue-loader": "^15.9.7",
    "vue-meta": "^3.0.0-alpha.2",
    "vue-nav-tabs": "^0.5.7",
    "vue-rate": "^2.4.0",
    "vue-router": "^4.0.0-0",
    "vue-typewriter": "^2.2.1",
    "vue3-carousel": "^0.1.13",
    "vue3-datepicker": "^0.2.4",
    "vue3-vt-notifications": "^1.0.0",
    "vuex": "^4.0.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0"
  }
}

In Addition, I don’t know if this related or not every time in run serve. it finish at 98% with this warning:

img3

Somebody please help me

1 Answer 1

0

I also encountered the same problem, and finally found that when I imported nanoid, deconstruction was not used. After adding {}, the error was resolved. You can see if it is the problem of importing third-party libraries.

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.