nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

`_typeof` is not a function #242

Closed chz closed 3 years ago

chz commented 3 years ago

Environment

Development, Local


Describe the bug and expected behavior

Actual: Vuex helper functions broken when using @nuxt/bridge Expected: Must work as before.

Steps to reproduce

  1. Any project where vuex helper functions used. Ex: computed:{ ...mapGetters({ sidebarOpened: 'sidebarOpened' }) }
  2. Follow guide: https://v3.nuxtjs.org/getting-started/bridge

Additional context

Screen Shot 2021-10-13 at 01 49 09

pi0 commented 3 years ago

/cc @danielroe

danielroe commented 3 years ago

@chz Would you provide a reproduction, please? 🙏

chz commented 3 years ago

@danielroe Check sandbox : https://codesandbox.io/s/hidden-grass-mpmd8 see console. For detail.

jimmyhayek commented 3 years ago

Same problem.

nathanchase commented 3 years ago

Can confirm that I'm receiving the same issue using ...mapState

adamchipperfield commented 3 years ago

+1

mehmetkursataydin commented 3 years ago

+1

arjanc commented 3 years ago

Getting the same issue when using the auth module which uses vuex as well. https://codesandbox.io/s/nuxt3-pwufw?file=/nuxt.config.js

In console log you see:

TypeError: _typeof is not a function

Is Vuex already implemented in nuxt3?

airmoi commented 3 years ago

+1

baixiaoyu2997 commented 3 years ago

can't commit,show error message: _typeof is not a function

franz-bendezu commented 3 years ago

+1

zarkroc commented 3 years ago

+1

danielroe commented 3 years ago

The issues you've been experiencing with vuex should be resolved with nuxt/framework#1026, but leaving issue open to track root cause.

Tahul commented 3 years ago

As a hint, I've experienced the same issue when trying to import .vue components that has already been built in a @nuxt/bridge project.

Fixed it by not building components and exporting them from my package as a raw .vue.

mehmetkursataydin commented 3 years ago

Having an issue with a package this time https://www.npmjs.com/package/vue-product-zoom

client.js?06a0:103 TypeError: _typeof is not a function
    at eval (app.bundle.js?6e0e:1)
    at Object.eval (app.bundle.js?6e0e:1)
    at eval (app.bundle.js:1495)
    at Object../node_modules/vue-product-zoom/dist/assets/js/app.bundle.js (0.js:10)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
    at eval (vue-product-zoom.js?5693:1)
    at Module../plugins/vue-product-zoom.js (1.js:11)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
Ydobro commented 3 years ago

@danielroe After applying fix(bridge): add vuex alias nuxt/framework#1026
Have another one with a package vueescroll and the most of 3rd party plugins.

vuescroll.js?77a0:10 Uncaught TypeError: _typeof2 is not a function
    at eval (vuescroll.js?77a0:10)
    at eval (vuescroll.js?77a0:13)
    at Object../node_modules/vuescroll/dist/vuescroll.js (app.js:2316)
    at __webpack_require__ (runtime.js:859)
    at fn (runtime.js:151)
    at eval (vuescroll.js?b443:1)
    at Module../plugins/vuescroll.js (app.js:2028)
    at __webpack_require__ (runtime.js:859)
    at fn (runtime.js:151)
    at eval (index.js:61)
revenkroz commented 3 years ago

I had the same error. The reason was the transpilation settings I used before.

Fixed the problem by removing @nuxt/babel-preset-app from presets section in babel.config.js (or in nuxt.config.js/babel). To make the specific features that I need work, I just installed the appropriate plugins. For example, @babel/plugin-proposal-optional-chaining and @babel/plugin-proposal-private-methods.

chz commented 3 years ago

@danielroe , @pi0 is this merged and updated in npm ? Because im getting error Uncaught TypeError: _typeof is not a function at isObject (vuex.common.js:155) at isValidMap (vuex.common.js:1223) at eval (vuex.common.js:1103) at eval (vuex.common.js:1241) at eval (transform.js?!./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/unplugin/dist/webpack/loaders/transform.js?!./node_modules/unplugin/dist/webpack/loaders/transform.js?!./components/Header/HeaderUser/LoggedIn.vue?vue&type=script&lang=js&:86) at Module../node_modules/unplugin/dist/webpack/loaders/transform.js?!./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/unplugin/dist/webpack/loaders/transform.js?!./node_modules/unplugin/dist/webpack/loaders/transform.js?!./components/Header/HeaderUser/LoggedIn.vue?vue&type=script&lang=js& (app.js:5845) at __webpack_require__ (runtime.js:854) at fn (runtime.js:151) at eval (LoggedIn.vue?vue&type=script&lang=js&:3) at Module../components/Header/HeaderUser/LoggedIn.vue?vue&type=script&lang=js& (app.js:1073)

hinaloe commented 3 years ago

I'm testing latest version (3.0.0-27242539.adf4970), but still having same error.

chz commented 3 years ago

I'm tested also with newest version (Version: 3.0.0-27242646.117b3aa), but same error