vuestorefront/vue-storefront

[Bug]: Must use import to load ES Module (glide.js)

SirDannyMunn opened this issue · 2 comments

Describe the Bug

After installation, when I run npm run dev, the application launches but then I get this error.

Current behavior

When I access the application in the browser after starting the dev server, this error is thrown

Expected behavior

To be taken to the homepage of the application

Steps to reproduce

Make sure you're using Node 14

Run:

npx @vue-storefront/cli generate store

npm install

npm run dev

Access the URL which is outputted in the console

What version of Vue Storefront are you using?

2.5.6

What version of Node.js are you using?

14.20.1

What browser (and version) are you using?

Chrome

What operating system (and version) are you using?

Wdinwos 11

Relevant log output

`Must use import to load ES Module: C:\Users\danie\Dev\js\artify\node_modules\@glidejs\glide\dist\glide.js require() of ES modules is not supported. require() of C:\Users\danie\Dev\js\artify\node_modules\@glidejs\glide\dist\glide.js from C:\Users\danie\Dev\js\artify\node_modules\vue-server-renderer\build.dev.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename glide.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\danie\Dev\js\artify\node_modules\@glidejs\glide\package.json.
`

Able to fix / change the documentation?

  • Yes
  • No

Code of Conduct

  • I agree to follow this project's Code of Conduct

It turns out the node version was causing the issue.

@SirDannyMunn I have the same error, what node version are you using to fix this? I have 16 and 14 and I get the error on Both