Skip to content

Quasar SSR mode error with vueuse/motion #64

@lukadriel7

Description

@lukadriel7

Hello, I am currently using quasar/app-vite and trying to add vueuse/motion to a project. It works without any problem in dev but the production mode shows an error:

Instead change the require of D:\DiskC\Documents\VSCode\Quasar\test\test-ssr\node_modules\@vueuse\motion\dist\index.mjs to a dynamic import() which is available in all CommonJS modules.
    at Module.<anonymous> (D:\DiskC\Documents\VSCode\Quasar\test\test-ssr\dist\ssr\server\server-entry.js:1:960)
    at Object.<anonymous> (D:\DiskC\Documents\VSCode\Quasar\test\test-ssr\dist\ssr\index.js:1:1517)
    at Object.<anonymous> (C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\@quasar\cli\bin\quasar-serve:113:5)
    at Object.<anonymous> (C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\@quasar\cli\bin\quasar:29:3) {
  code: 'ERR_REQUIRE_ESM'
}

I tried on webpack but got a similar error even in dev:

[Quasar Dev Webserver] / -> error during render
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\DiskC\Documents\VSCode\Quasar\quasar-project\node_modules\@vueuse\motion\dist\index.mjs not supported.
Instead change the require of D:\DiskC\Documents\VSCode\Quasar\quasar-project\node_modules\@vueuse\motion\dist\index.mjs to a dynamic import() which is available in all CommonJS modules.

My guess is that it is because the server uses CommonJS but tries to require an ES module. Has anyone encountered this problem before or know how to solve it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions