Skip to content

Does not work with vue compat mode #6147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
akobrinsky opened this issue Dec 8, 2022 · 5 comments
Closed
1 task done

Does not work with vue compat mode #6147

akobrinsky opened this issue Dec 8, 2022 · 5 comments

Comments

@akobrinsky
Copy link

akobrinsky commented Dec 8, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.15

Environment

  System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    Memory: 10.03 GB / 62.02 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.8.0 - /usr/local/bin/node
    npm: 7.21.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Firefox: 107.0
  npmPackages:
    @vitejs/plugin-vue: ^3.2.0 => 3.2.0 
    ant-design-vue: ^3.2.15 => 3.2.15 
    vite: ^3.2.3 => 3.2.3 

Reproduction link

https://github.com/akobrinsky/vite-ant-design-compat

Steps to reproduce

  • npm i
  • npm serve
  • in vite.config.js, toggle between the vue.esm-bundler.js compiler and @vue/compat

vue.esm-bundler.js works perfectly and @vue/compat does not

Simple config:

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          compatConfig: {
            MODE: 3
          }
        }
      }
    })
  ],
  resolve: {
    alias: {
      // this compiler works fine but compat does not
      'vue': 'vue/dist/vue.esm-bundler.js'
      // 'vue': '@vue/compat'
    },
  },
});

What is expected?

We are migrating a large app over to Vue 3 and ant design vue seems to be our final battle. A minimal reproduction has been attached. The vue.esm-bundler.js compiler works perfectly, but when I switch to @vue/compat and wire up compat mode, I get an error and app won't render.

What is actually happening?

App will not load and we see this error in the console when using compat mode.

Uncaught TypeError: useConfigInject_default is not a function
Empty2 empty.js:4
convertLegacyAsyncComponent vue.runtime.esm-bundler.js:9888
convertLegacyComponent vue.runtime.esm-bundler.js:9925
_createVNode vue.runtime.esm-bundler.js:10165
createVNodeWithArgsTransform vue.runtime.esm-bundler.js:10050
<anonymous> index.js:14
empty.js:4:41
@STsaruk
Copy link

STsaruk commented Dec 27, 2022

I have the same error. It will be very difficult to migrate if the ui-framework where most of the errors come from does not work in compat mode

@staifa
Copy link

staifa commented Dec 28, 2022

Same here!

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@pibemillo
Copy link

This was not resolved as expected by: #5765

I am also unable to get this work with @vue/compat. Hoping for a resolution as I need to migrate and upgrade Vue and Ant

Copy link

github-actions bot commented Mar 8, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants