Comments (19)
Hi,
I have the same error, just installing the package results in this error. Even before changing the connector in next.config.js
Installing version 1.0.2 of the connector worked for me
npm install [email protected]
Best,
Vincent
from magento2-connector.
None of these solutions seems to work for me. Is there a minimum required Magento 2 version?
from magento2-connector.
@pablolgarcia I've tried multiple ways to reach out to the company and they are unresponsive. I have made some patches to the code to work past some of the issues and limitations in the code but still not able to have everything fully function. We need the author's help or more time spent on the community side (you and I) on fixing it.
from magento2-connector.
Hi @emehran.
What's your upstream (i.e. M2_CONFIG_HOST)?
Could you provide more of error data you're getting?
Thanks!
from magento2-connector.
I'm also not able to get the connector working with the initial installation of react-storefront
1 of 1 unhandled error
Server Error
FetchError: invalid json response body at http://localhost:3000/api/s/117?_includeAppData=1 reason: Unexpected token I in JSON at position 0
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
pages/_app.js (54:16) @ async Function.MyApp.getInitialProps
52 |
53 | if (Component.getInitialProps) {
> 54 | pageProps = await Component.getInitialProps(ctx)
| ^
55 | }
56 |
57 | return { pageProps }
Show collapsed frames
when localhost:3000/api?_includeAppData=1 is being requested, the following is put console:
TypeError: Object(...) is not a function
at eval (webpack-internal:///./pages/api/index.js:6:89)
at apiResolver (/Users/mcjambi/repos/react-storefront-test/node_modules/next/dist/next-server/server/api-utils.js:8:7)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async DevServer.handleApiRequest (/Users/mcjambi/repos/react-storefront-test/node_modules/next/dist/next-server/server/next-server.js:47:397)
at async Object.fn (/Users/mcjambi/repos/react-storefront-test/node_modules/next/dist/next-server/server/next-server.js:39:218)
at async Router.execute (/Users/mcjambi/repos/react-storefront-test/node_modules/next/dist/next-server/server/router.js:23:67)
at async DevServer.run (/Users/mcjambi/repos/react-storefront-test/node_modules/next/dist/next-server/server/next-server.js:49:494)
at async DevServer.handleRequest (/Users/mcjambi/repos/react-storefront-test/node_modules/next/dist/next-server/server/next-server.js:17:101)
from magento2-connector.
I'm having the same problem, with the following terminal output:
TypeError: Object(...) is not a function at eval (webpack-internal:///./pages/api/index.js:6:89) at apiResolver (/.../node_modules/next/dist/next-server/server/api-utils.js:8:7) at process.internalTickCallback (internal/process/next_tick.js:77:7) { FetchError: invalid json response body at http://localhost:3000/api?_includeAppData=1 reason: Unexpected token I in JSON at position 0 at /.../node_modules/next/dist/compiled/node-fetch/index.js:1:133652 at process.internalTickCallback (internal/process/next_tick.js:77:7) message: 'invalid json response body at http://localhost:3000/api?_includeAppData=1 reason: Unexpected token I in JSON at position 0', type: 'invalid-json' }
I'm running M2 locally on Docker and have configured my dotenv file with M2_CONFIG_HOST.
from magento2-connector.
I can confirm, the pristine installation, following the guide, will result in error.
http://localhost:3000/api?_includeAppData=1
Results in:
Internal Server Error
Maybe it's something missing from the documentation?
from magento2-connector.
Could this be related to #26 ?
You can try to check Magento 2 logs and see if it makes it there. This was how I discovered the source of my issue with the default install.
You can run:
tail -f var/log/exception.log
Reload the page, and you will see the error, if it is happening in Magento.
from magento2-connector.
Running into the same issue on my end. Request isn't showing up in var/log/exception.log
or any other magento logs. Downgrading from "react-storefront-magento2-connector": "^1.0.3"
to "react-storefront-magento2-connector": "^1.0.2"
also didn't make a difference. Any ideas on other things I could try to resolve this?
I'm getting the following errors:
Server Error
FetchError: invalid json response body at http://localhost:2020/api?_includeAppData=1 reason: Unexpected token I in JSON at position 0
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
pages/_app.js (86:16) @ async Function.MyApp.getInitialProps
84 |
85 | if (Component.getInitialProps) {
> 86 | pageProps = await Component.getInitialProps(ctx)
| ^
87 | }
88 |
89 | return { pageProps }
FetchError: request to https://magento.redacted.net/graphql failed, reason: connect ETIMEDOUT XXX.XX.XXX.XXX:443
at ClientRequest.<anonymous> (/Users/react-storefront-example/src/node_modules/next/dist/compiled/node-fetch/index.js:1:66404)
at ClientRequest.emit (node:events:327:20)
at TLSSocket.socketErrorListener (node:_http_client:478:9)
at TLSSocket.emit (node:events:327:20)
at emitErrorNT (node:internal/streams/destroy:194:8)
at emitErrorCloseNT (node:internal/streams/destroy:159:3)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
My .env file looks like this:
LEGACY_BACKEND_DOMAIN=magento.redacted.net
LEGACY_BACKEND_HOST_HEADER=magento.redacted.net
M2_CONFIG_HOST=http://magento.redacted.net
from magento2-connector.
I have the same issue. Any solution?
from magento2-connector.
vperrin's solution worked for me, in a sense. I can now launch the landing page with the products loaded, but navigating off that page results in errors. :
"Hi,
I have the same error, just installing the package results in this error. Even before changing the connector in next.config.js
Installing version 1.0.2 of the connector worked for me
npm install [email protected]Best,
Vincent"
from magento2-connector.
Vperrin's solution right but in this case, we lose the new features Main features: PLP, PDP, and Cart page at the last version
versions 1.0.3 and 1.0.4 not working but the reason?
from magento2-connector.
Installing version 1.0.2
worked for me.
from magento2-connector.
Same issue here. I downgraded to 1.0.2 and it's working now but the new features have been lost.
from magento2-connector.
I have the same issue. Is there any other solution to solve this? Please help me.
from magento2-connector.
Hey authors! Any words? With this error nobody can use this connector.
from magento2-connector.
the old 1.0.2 connector works for me but it has its own issues. I'm still looking for solutions
one thing they mentioned in the doc is to directly use the API in pages/api folder, ill see if it thing works.
from magento2-connector.
I have the same issue
Node v16.14
Mac Monterey 12
even installing 1.0.2 doesn't help for me
from magento2-connector.
I got the page to show items with this magento connector
So i'm using 1.0.2 for now
The way i can see some products on the page is by
1 - clicking on one of the categories
2 - page won't really display any products
3 - manually refresh the page (you should see products and filters)
from magento2-connector.
Related Issues (12)
- Add to cart from CMS slot product links results in an error
- [Low Priority] ERR_HTTP_HEADERS_SENT warning HOT 1
- No matching version found for create-react-storefront@^8.014.0 HOT 1
- Subcategory link error HOT 1
- Add eslint
- [Low Priority] .eslintrc.js - parsing error: "parserOptions.project" has been set for @typescript-eslint/parser
- Products and sub categories not loading HOT 1
- No option for store code, only "default" store code works
- Add to cart is not working .
- Starter Demo App crashes on installing react-storefront-magento2-connector HOT 1
- Remove `create-index` package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magento2-connector.