Git Product home page Git Product logo

w3bdesign / nextjs-woocommerce Goto Github PK

View Code? Open in Web Editor NEW
459.0 7.0 114.0 9.12 MB

๐Ÿ”ฅ Next.js (React) headless eCommerce site with Typescript, WordPress (WooCommerce) backend and Algolia search

Home Page: https://next-woocommerce.dfweb.no

License: GNU General Public License v3.0

JavaScript 3.37% CSS 0.63% TypeScript 96.00%
nextjs react es6 woocommerce-api woocommerce graphql ecommerce-site wp-graphql algolia-search algolia

nextjs-woocommerce's Issues

Graphql Error

ApolloError: Cannot query field "allPaColors" on type "VariableProduct".
Cannot query field "allPaSizes" on type "VariableProduct"

Use CoCart to complete project

I think you will be able to complete this project with the help of my plugin CoCart specially with the session handling. Let me know if you have any questions.

Apollo look like limited the JSON result?

I used this query to fetch all product from my store:

query MyQuery { products(first: 1000) { nodes { id image { sourceUrl } name onSale productCategories { nodes { slug } } productTags { nodes { slug } } sku status totalSales type visibleProducts { nodes { slug isRestricted } } ... on VariableProduct { manageStock onSale price(format: RAW) regularPrice(format: RAW) salePrice(format: RAW) soldIndividually weight width } ... on ExternalProduct { onSale price(format: RAW) regularPrice(format: RAW) salePrice(format: RAW) } ... on SimpleProduct { price(format: RAW) regularPrice(format: RAW) salePrice(format: RAW) virtual weight width } } } }

But, I received the error:

ApolloError: Response not successful: Received status code 500 at new ApolloError (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/errors/errors.cjs.js:31:28) at /Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/core/core.cjs.js:1490:19 at /Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/utilities/utilities.cjs.js:958:69 at new Promise (<anonymous>) at Object.error (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/utilities/utilities.cjs.js:958:21) at notifySubscription (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:140:18) at onNotify (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:179:3) at SubscriptionObserver.error (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:240:7) at /Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/utilities/utilities.cjs.js:946:68 at Array.forEach (<anonymous>) at iterateObserversSafely (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/utilities/utilities.cjs.js:946:25) at Object.error (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/utilities/utilities.cjs.js:1031:21) at notifySubscription (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:140:18) at onNotify (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:179:3) at SubscriptionObserver.error (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:240:7) at Object.error (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/zen-observable/lib/Observable.js:330:22) { graphQLErrors: [], networkError: Error [ServerError]: Response not successful: Received status code 500 at Object.throwServerError (/Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/link/utils/utils.cjs.js:45:17) at /Volumes/DATA/OwnCode/viet-healthy-dn/node_modules/@apollo/client/link/http/http.cjs.js:32:19 at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) { response: Response { size: 0, timeout: 0, [Symbol(Body internals)]: [Object], [Symbol(Response internals)]: [Object] }, statusCode: 500, result: { code: 'internal_server_error', message: '<p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/debugging-in-wordpress/">Learn more about debugging in WordPress.</a></p>', data: [Object], additional_errors: [] } }, extraInfo: undefined }

It's look like any limit are here? I don't know. How can I solved this issue?
I just wanna fetch all products (about only 154 items) for SSG. I dont want pagination here.

Footer

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

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

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Issue when npm run dev

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle [email protected]predev: [email protected]
6 info lifecycle [email protected]
dev: [email protected]
7 verbose lifecycle [email protected]dev: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\felix\Downloads\nextjs-woocommerce-master\node_modules.bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\felix\AppData\Roaming\npm;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\PuTTY;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Apache24\bin;C:\Program Files\dotnet;C:\xampp\php;C:\composer;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Program Files (x86)\Bitvise SSH Client;C:\Program Files\Git\cmd;C:\Users\felix\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\felix\AppData\Local\Programs\Python\Python38-32;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\felix\AppData\Local\Microsoft\WindowsApps;C:\Users\felix\AppData\Local\GitHubDesktop\bin;C:\Users\felix\AppData\Local\atom\bin;C:\Users\felix.dotnet\tools;C:\Users\felix\AppData\Roaming\Composer\vendor\bin;C:\Users\felix\AppData\Local\Microsoft\WindowsApps;C:\Users\felix\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle [email protected]dev: CWD: C:\Users\felix\Downloads\nextjs-woocommerce-master
10 silly lifecycle [email protected]
dev: Args: [ '/d /s /c', 'next dev' ]
11 silly lifecycle [email protected]dev: Returned: code: 1 signal: null
12 info lifecycle [email protected]
dev: Failed to exec dev script
13 verbose stack Error: [email protected] dev: next dev
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:376:20)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:376:20)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\felix\Downloads\nextjs-woocommerce-master
16 verbose Windows_NT 10.0.19045
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "dev"
18 verbose node v14.17.0
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] dev: next dev
22 error Exit status 1
23 error Failed at the [email protected] dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Token expiration

When we add a product to the cart, and visit the store a week later or so, we get a token expiration error.

The fix for this is to manually clear the local storage, which is not ideal.

Todo

  • Token structure (do not use object)
  • Margin bottom mobile

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm react-instantsearch-dom Unavailable

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/codeql.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/playwright.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/upload-artifact v4
npm
package.json
  • @apollo/client ^3.11.4
  • @types/react ^18.3.3
  • algoliasearch ^4.24.0
  • autoprefixer ^10.4.20
  • framer-motion 11.3.24
  • graphql ^16.9.0
  • lodash ^4.17.21
  • next ^14.2.5
  • nprogress ^0.2.0
  • postcss ^8.4.41
  • react ^18.3.1
  • react-dom ^18.3.1
  • react-hook-form ^7.52.2
  • react-instantsearch-dom ^6.40.4
  • uuid ^10.0.0
  • @playwright/test ^1.46.0
  • @types/lodash ^4.17.7
  • @types/node 20.14.15
  • @types/nprogress ^0.2.3
  • @types/react-instantsearch-dom ^6.12.8
  • @types/uuid ^10.0.0
  • @typescript-eslint/eslint-plugin ^8.0.1
  • @typescript-eslint/parser ^8.0.1
  • babel-plugin-styled-components ^2.1.4
  • eslint 8.57.0
  • eslint-config-next ^14.2.5
  • postcss-preset-env ^9.6.0
  • prettier ^3.3.3
  • tailwindcss ^3.4.9
  • typescript ^5.5.4

  • Check this box to trigger a request for Renovate to run again on this repository

Add Favicon

It looks like a favicon is missing for this website.

Adding a favicon for this website will help identify this project amongst a bunch of tabs.
I'm open for discussion.

Pls assign this issue to me so that I can work on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.