Tap-Payments / goSell-checkout-sandbox-doc

0 stars 0 forks source link

react build issue using nextjs framework #1

Open Abdulla97 opened 4 years ago

Abdulla97 commented 4 years ago

hello,

I am facing build issue when npm package for GoSell

tap-next-err

I am not able to build because of Global css from node_modules
next team response https://github.com/vercel/next.js/blob/master/errors/css-npm.md

anaszaman commented 3 years ago

Its because of NextJS, find the file and add CSS into your _app.js

Abdulla97 commented 3 years ago

yeah I already solve it by dynamic importing with disabling SSR in that component

ahmed-abdelhamid commented 3 years ago

@Abdulla97 Do you really manage to solve that issue? because even with dynamic import and disabling SSR it keeps crashes on the build process

anaszaman commented 3 years ago

Modified a little bit to work with NextJS, give it a try https://github.com/FassetIO/tap-payments

ahmed-abdelhamid commented 3 years ago

Ok great, but how I use it. Can I install it like a npm library or I have to make these modifications manually?

anaszaman commented 3 years ago

package.json "@tap-payments/gosell": "FassetIO/tap-payments",

ahmed-abdelhamid commented 3 years ago

Thank you for your help

Abdulla97 commented 3 years ago

@Abdulla97 Do you really manage to solve that issue? because even with dynamic import and disabling SSR it keeps crashes on the build process

hello

add this to the payment componet index.js
import dynamic from 'next/dynamic'

const DynamicComponentWithNoSSR = dynamic( () => import('./Payment'), { ssr: false } )

function PaymentIndex() { return (

) }

export default PaymentIndex

FaysalMaqbool commented 2 years ago

@Abdulla97 i have implemented the above code but it still giving the same issue

FaysalMaqbool commented 2 years ago

package.json "@tap-payments/gosell": "FassetIO/tap-payments",

after adding this dependency it give the error "window is not defined"

anaszaman commented 2 years ago

package.json "@tap-payments/gosell": "FassetIO/tap-payments",

after adding this dependency it give the error "window is not defined"

Make sure to remove previous tap-payment module.

FaysalMaqbool commented 2 years ago

@anaszaman the error still exist after removing last module first i run yarn remove @tap-payments/gosell then i added "@tap-payments/gosell": "FassetIO/tap-payments", in my package.json and run yarn it still gives me the same error even after removing cache and node-modules.

BrodieCruz commented 2 years ago

Has anyone fixed this problem? If I change version to "FassetIO/tap-payments" - i get "window is not defined" error. How to make it work with NEXT??

Doaa-Ismael commented 1 year ago

I solved it by using this package, and wrapping GoSell component with another component so that I can lazy load it by using Next js dynamic imports.

jk-baseer commented 10 months ago

Hi Guys, We are also facing the same issue in our nextjs project. @Doaa-Ismael we tried this but it didn't help. Can you tell us more on how to achieve this?

@AhmedElsharkawyCS is it possible your team can prepare a package for Nextjs or a sample repo for people to duplicate?

anaszaman commented 10 months ago

Looks like FassetIO org removed this package, I will check my local repos and try to publish under my name.

jk-baseer commented 10 months ago

@anaszaman Thanks bro, so what exactly is the issue? May be we can try from our end as well.

anaszaman commented 10 months ago

See if this works https://github.com/anaszaman/tap-payments, otherwise I will publish npm package.

Ahsan-Ullah1871 commented 10 months ago

See if this works https://github.com/anaszaman/tap-payments, otherwise I will publish npm package.

Hello,

I tried using it with your project, but I noticed that it's self-installing and not functioning properly. After removing all the node modules and attempting to reinstall, I found that it installed, but it's still not working. It's displaying an issue where the GoSell functions are not operational.

Upon inspecting your project's package.json file, I observed that an older version of the GoSell package is in use. Is it feasible to update it to the latest version and consider publishing it as a package?

That will be greatly helpful. Thank you in advance!