Skip to content
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

2.9.2 regression - Cannot read properties of null (reading 'isCE') #7721

Closed
7 tasks done
jzs11 opened this issue Apr 13, 2022 · 9 comments
Closed
7 tasks done

2.9.2 regression - Cannot read properties of null (reading 'isCE') #7721

jzs11 opened this issue Apr 13, 2022 · 9 comments
Labels
has workaround p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) regression The issue only appears after a new release

Comments

@jzs11
Copy link

jzs11 commented Apr 13, 2022

Describe the bug

Please use provided repo and run npm run dev then open developer console you will see the error.
Downgrade to 2.9.1 problem is gone.

Reproduction

https://github.com/jzs11/vite-regression-playground

System Info

System:
    OS: macOS 12.3.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 4.11 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.8.0 - /usr/local/bin/node
    Yarn: 1.22.15 - /usr/local/bin/yarn
    npm: 8.5.5 - /usr/local/bin/npm
  Browsers:
    Chrome: 100.0.4896.88
    Firefox: 99.0
    Safari: 15.4
  npmPackages:
    @vitejs/plugin-vue: 2.3.1 => 2.3.1 
    vite: 2.9.2 => 2.9.2

Used Package Manager

npm

Logs

image

Validations

@sapphi-red sapphi-red added the regression The issue only appears after a new release label Apr 14, 2022
@sodatea
Copy link
Member

sodatea commented Apr 14, 2022

Caused by my PR: #7582

devextreme-vue requires the CJS build of vue, while primevue imports the ESM version.

I'm not sure how to fix it yet.

@sodatea sodatea added p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) bug and removed pending triage labels Apr 14, 2022
@carl-jin
Copy link

try this, force him to use esm bunder.

export default defineConfig(({ command }) => {
  return {
    resolve: {
      alias: [
        {
          find: "@vue/runtime-core",
          replacement: "@vue/runtime-core/dist/runtime-core.esm-bundler.js",
        },
      ],
    },
  };
});

The reason for this is because if your project import a package thats is export by cjs, for some reason, the vue-core runtime will also import cjs, that's why we got an error here, btw this also causes the hmr not works in vue file.

@jzs11
Copy link
Author

jzs11 commented Apr 14, 2022

Thanks for the response; it is working as expected. Feel free to close the ticket as it has a workaround :)

The third workaround by using the resolve alias.

image

@sodatea
Copy link
Member

sodatea commented Apr 14, 2022

An alias for vue$ would suffice:

  resolve: {
    alias: [
      {
        find: '@',
        replacement: path.resolve(__dirname, 'src'),
      },
      {
        find: 'vue$',
        replacement: 'vue/dist/vue.runtime.esm-bundler.js',
      },
    ],
  },

@riskihajar
Copy link

try this, force him to use esm bunder.

export default defineConfig(({ command }) => {
  return {
    resolve: {
      alias: [
        {
          find: "@vue/runtime-core",
          replacement: "@vue/runtime-core/dist/runtime-core.esm-bundler.js",
        },
      ],
    },
  };
});

The reason for this is because if your project import a package thats is export by cjs, for some reason, the vue-core runtime will also import cjs, that's why we got an error here, btw this also causes the hmr not works in vue file.

thanks, hmr vue working now

@filiptammergard
Copy link

I think I'm having a related problem. ^2.9.2 makes my React+Vite crash on development. 2.9.1 is fine.

image

@patak-dev
Copy link
Member

Please update to vite@2.9.5, where #7582 have been reverted

@jzs11
Copy link
Author

jzs11 commented Apr 14, 2022

I can confirm it is now working as expected after upgrading to 2.9.5.
Thank you guys for your effort.

@ZQ-jhon
Copy link

ZQ-jhon commented Apr 18, 2022

try this, force him to use esm bunder.

export default defineConfig(({ command }) => {
  return {
    resolve: {
      alias: [
        {
          find: "@vue/runtime-core",
          replacement: "@vue/runtime-core/dist/runtime-core.esm-bundler.js",
        },
      ],
    },
  };
});

The reason for this is because if your project import a package thats is export by cjs, for some reason, the vue-core runtime will also import cjs, that's why we got an error here, btw this also causes the hmr not works in vue file.

Thanks, useful for me!

@github-actions github-actions bot locked and limited conversation to collaborators May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has workaround p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) regression The issue only appears after a new release
Projects
None yet
Development

No branches or pull requests

8 participants