-
Notifications
You must be signed in to change notification settings - Fork 132
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
Production build not working with @adyen/adyen-web/auto #2818
Comments
Hey @tlenclos , Can you by any chance provide a reproducible example and share with us? That would be the easiest way for us to investigate. Perhaps create a minimal Github repo with your setup, which we can build and start a local server serving the static files (no need to make APi calls, those can be mocked). Otherwise it is hard to troubleshoot this. We have tested the Can you also tell me what do you get when you run |
I'll see if I can make a reproducer. In the meantime, I got this when running {
"version": "6.1.0",
"bundleType": "eslegacy"
} We are not using Next.js, just Vite with an SPA app. Even though we are importing like so : For example I had to add Twint and setup it manually in order to display it, and we need automatic setup without explicitely requiring payment methods. import {
AdyenCheckout,
CoreConfiguration,
Dropin,
DropinConfiguration,
+ Twint,
} from '@adyen/adyen-web/auto';
...
new Dropin(checkout, {
paymentMethodComponents: [Twint],
paymentMethodsConfiguration,
}).mount(container.current); |
It seems like the module resolution mechanism of your application is ignoring the 'auto' bundle path and doing the fallback to the 'eslegacy' bundle type, which is usually used with setups that are using Webpack 4 for example. By seeing the "eslegacy" , I can tell that the "auto" mode is not being loaded indeed. You mentioned Vite with an SPA - can you elaborate a bit more on this setup? Are you using Webpack 4 by any chance or any other bundler? This SPA - how was it generated? I'd like to help you here and investigate this further, but it is hard without having an reproducible repo with the proper dependencies that you are using. Do you think it is possible to provide a bare minimum project skeleton with the project dependencies, so we can take a closer look into it? No need to implement any code into it - just scaffold a repo that contains your dependencies and make sure that the web app starts when running |
We also had the same issue in an Open-WC project (Lit + rollup + babel). For now we worked around by importing the components from @adyen/adyen-web instead. And in the function where we create our Dropin Configuration, we register the classes similar to how it's done in the "auto" import: |
Same issue here, the components don't seem to load using the /auto import 😥 |
@tlenclos here is a code repo using Vite 5.1.6 with the auto package with some mocked payment methods: https://stackblitz.com/edit/vitejs-vite-w7iztm?file=main.js - can you let me know if I am missing something? @bramdebouvere could you provide a small reproducible example (same as I shared above using 'stackblitz'), so we can have a look? That would be very helpful @jellevdv can you share more details about your setup - which framework/bundler is involved? it would be great too if you can provide an example for us. |
@jellevdv More specifically |
@bramdebouvere here is an example using Open-WC project (Lit + rollup + babel): https://stackblitz.com/edit/openwc-lit-rollup-babel?file=src%2Fadyen-v6-demo.js - can you let me know what is missing in this case? The 'auto' seems to work as expected (once the dev server starts, it will take couple of seconds to render the UI) |
@ribeiroguilherme yes in development mode it works properly, the issue is only in production with the build. I downloaded the example on https://stackblitz.com/edit/vitejs-vite-w7iztm?file=main.js Then ran in dev and prod respectively with |
@tlenclos thanks for checking it out. I missed the detail that it was impacting only prod build. I will take further look. |
Hello @ribeiroguilherme, did you look into this issue again ? Let me know if I can be of any help. It's blocking us to upgrade to V6 for now. |
@ribeiroguilherme Sorry that I have not found the time to look at this yet. I'll try to free up some time soon. |
I confirm that the suggested fix here is working for us too #2818 (comment) |
@tlenclos @bramdebouvere we released v6.5.0 which contains a fix for this issue. Could you guys test it out and confirm the the issue is fixed? 🙏 |
@ribeiroguilherme Just tested this, seems to fix the issue here. Thanks! |
@bramdebouvere thanks for checking it and for reporting the issue. I will close this thread. Cheers! |
Describe the bug
Hello ! We are in the process of migrating the library from 5.59.0 to 6.1.0 and we use Vite to build our project.
It seems that the
@adyen/adyen-web/auto
export doesn't work as expected since we encounter these messages when running the production build and the Dropin does not show :It works fine with the dev server.
To Reproduce
Steps to reproduce the behavior:
@adyen/adyen-web/auto
Expected behavior
Dropin should show.
Additional context
The text was updated successfully, but these errors were encountered: