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

[BUG]: glidejs cause error #2494

Closed
AdamPawlinski opened this issue Sep 29, 2022 · 10 comments
Closed

[BUG]: glidejs cause error #2494

AdamPawlinski opened this issue Sep 29, 2022 · 10 comments
Labels
bug Something isn't working v1.x.x Issues regarding SFUI 1.x.x

Comments

@AdamPawlinski
Copy link
Contributor

AdamPawlinski commented Sep 29, 2022

Describe the bug
When trying to run project with SFUI 0.13.3 version this bug appears:
Screenshot from 2022-09-29 08-13-10

Probably downgrading glidejs version should help.

How to reproduce
Steps to reproduce the behavior:

  1. run project with SFUI 0.13.3
  2. see the error

Expected behavior
App runs normally.

Code examples
Sample code (or your configuration) to help us reproduce the bug faster or to understand your use case.

//Write code here

Or add code snippets (Code sandbox)

Screenshots
If applicable, add screenshots to help explain your problem.

Devices (please complete the following information):

  • Device: [e.g. iPhone6, Desktop]
  • OS: [e.g. iOS8.1]
  • Browser: [e.g chrome, safari][version]

Additional context
Anything you would like to add but was not sure which section it fits. For example: tech stack used (Nuxt, Vue, Gridsome, React, etc)

┆Issue is synchronized with this Jira Task by Unito

@AdamPawlinski AdamPawlinski added the bug Something isn't working label Sep 29, 2022
@AdamPawlinski AdamPawlinski changed the title [BUG]: glidejs newest version cause error [BUG]: glidejs cause error Sep 29, 2022
@tm0e83
Copy link

tm0e83 commented Oct 4, 2022

This is actually happening after running the shopware/cli dev command. I couldn't solve it so far. Does anyone know what to do here?

@cdeclerck
Copy link

The only solution I found for the moment is to put a resolution of the glidejs module in version 3.6.0 and to change the import of the module from "@glidejs/glide" to "@glidejs/glide/dist/glide.modular.esm"

@tm0e83
Copy link

tm0e83 commented Oct 4, 2022

glideJS isn't imported anywhere. I couldn't find a reference.

@davidwindell
Copy link

davidwindell commented Oct 6, 2022

Yep, getting this on VSF Magento 1.0.2 as well.

GlideJS 3.6.0 changelog says:

Add package.json "type" field by @julienchazal in glidejs/glide#623

@bensinca
Copy link
Contributor

bensinca commented Oct 6, 2022

Yep, getting this on VSF Magento 1.0.2 as well.

GlideJS 3.6.0 changelog says:

Add package.json "type" field by @julienchazal in glidejs/glide#623

downgrading to 3.5.2 works.

@chrisalexqm
Copy link

Yep, getting this on VSF Magento 1.0.2 as well.
GlideJS 3.6.0 changelog says:

Add package.json "type" field by @julienchazal in glidejs/glide#623

downgrading to 3.5.2 works.

How are you downgrading, I am use Vue Storefront? Help me please, I tried override on package.json

@bensinca
Copy link
Contributor

The only solution I found for the moment is to put a resolution of the glidejs module in version 3.6.0 and to change the import of the module from "@glidejs/glide" to "@glidejs/glide/dist/glide.modular.esm"

@chrisalexqm use resolutions e.g:

"resolutions": { "@glidejs/glide": "3.5.2" }

@rcpfuchs
Copy link

Just copy pasted the string from the image so the error can be found using search

require() of ES Module /Users/myuser/projects/vuestorefront/node_modules/@glidejs/glide/dist/glide.js from /Users/myuser/projects/vuestorefront/node_modules/vue-server-renderer/build.dev.js not supported. glide.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules. Instead rename glide.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/myuser/projects/vuestorefront/node_modules/@glidejs/glide/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

@cdeclerck
Copy link

If you do your init with this command "npx @shopware-pwa/cli@canary init" it should work (this version corresponds to the latest version under development which patches this problem)

@FRSgit FRSgit added the v1.x.x Issues regarding SFUI 1.x.x label Mar 25, 2023
@AdamPawlinski
Copy link
Contributor Author

I'm closing this ticket as it doesn't meet the requirements of LTS policy..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1.x.x Issues regarding SFUI 1.x.x
Projects
None yet
Development

No branches or pull requests

8 participants