DivanteLtd / shopware2vuestorefront

First Progressive Web App for Shopware 6. Made with ❤️ by Vue Storefront

Home Page:https://vuestorefront.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't make it work.

rain-manek opened this issue · comments

I'm trying to make it work.

What I've done so far:

  1. I've got Shopware 6 running in docker.
  2. I've got vue-storefront running on port localhost:3000
  3. I've got vue-storefront-api running.

Nextly I started to move on with instructions from README.md

At this point: "Download the Indexer and Api Extension":

  1. I've done "First - Integrate the Dynamic Requests calls" section.
  2. But I'm stuck on next section:
    I've got vsf-shopware-indexer directory on the same level as others. I edited config so it looks like this:
    module.exports = { map: { attribute: { color: '<COLOR ATTRIBUTE ID TAKEN FROM ElasticSearch after indexation>', size: '<SIZE ATTRIBUTE ID TAKEN FROM ElasticSearch after indexation>' } }, api: { protocol: 'http', host: 'localhost:8000', token: 'SWSCTJLGEMV1TJE0BVBKANVBRQ', client_id: '', client_secret: '', grant_type: '', version: 'v1', prefix: 'sales-channel-api' }, elasticsearch: { host: 'localhost', port: 9200, logLevel: 'warn', indexName: 'vue_storefront_catalog' }, logger: { winston: { file: { level: 'info', filename: 'http://localhost:8000'}/logs/app.log', handleExceptions: true, json: true, maxsize: 5242880, maxFiles: 5, colorize: false }, console: { level: 'debug', handleExceptions: true, json: false, colorize: true } } } };

I runned yarn install.
And those commands fails:
image

After running first I get it in console:

2020-02-05 12:33:47 info: attributes are being rebuilt... (page: 1; size: 100)
{ Error: Request failed with status code 400
at createError (/home/pablo/Projects/storeFront/vsf-shopware-indexer/node_modules/axios/lib/core/createError.js:16:15)
at settle (/home/pablo/Projects/storeFront/vsf-shopware-indexer/node_modules/axios/lib/core/settle.js:18:12)
at IncomingMessage.handleStreamEnd (/home/pablo/Projects/storeFront/vsf-shopware-indexer/node_modules/axios/lib/adapters/http.js:202:11)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
config:
{ adapter: [Function: httpAdapter],
transformRequest: { '0': [Function: transformRequest] },
transformResponse: { '0': [Function: transformResponse] },
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
headers:
{ Accept: 'application/json, text/plain, /',
'Content-Type': 'application/json;charset=utf-8',
'User-Agent': 'axios/0.18.1',
'Content-Length': 71 },
method: 'post',
url: 'http://localhost:8000/api/oauth/token',
data:
'{"scopes":"write","client_id":"administration","grant_type":"password"}' },
request:
ClientRequest {
_events:
{ socket: [Function],
abort: [Function],
aborted: [Function],
error: [Function],
timeout: [Function],
prefinish: [Function: requestOnPrefinish] },
_eventsCount: 6,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket:
Socket {
connecting: false,
_hadError: false,
_handle: [TCP],
_parent: null,
_host: 'localhost',
_readableState: [ReadableState],
readable: true,
_events: [Object],
_eventsCount: 7,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
parser: null,
_httpMessage: [Circular],
[Symbol(asyncId)]: 16,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 },
connection:
Socket {
connecting: false,
_hadError: false,
_handle: [TCP],
_parent: null,
_host: 'localhost',
_readableState: [ReadableState],
readable: true,
_events: [Object],
_eventsCount: 7,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
parser: null,
_httpMessage: [Circular],
[Symbol(asyncId)]: 16,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 },
_header:
'POST /api/oauth/token HTTP/1.1\r\nAccept: application/json, text/plain, /\r\nContent-Type: application/json;charset=utf-8\r\nUser-Agent: axios/0.18.1\r\nContent-Length: 71\r\nHost: localhost:8000\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent:
Agent {
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 80,
protocol: 'http:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256 },
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/api/oauth/token',
_ended: true,
res:
IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
socket: [Socket],
connection: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 400,
statusMessage: 'Bad Request',
client: [Socket],
_consuming: false,
_dumped: false,
req: [Circular],
responseUrl: 'http://localhost:8000/api/oauth/token',
redirects: [] },
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable:
Writable {
_writableState: [WritableState],
writable: true,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
_options: [Object],
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 71,
_requestBodyBuffers: [],
_onNativeResponse: [Function],
_currentRequest: [Circular],
_currentUrl: 'http://localhost:8000/api/oauth/token' },
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]:
{ accept: [Array],
'content-type': [Array],
'user-agent': [Array],
'content-length': [Array],
host: [Array] } },
response:
{ status: 400,
statusText: 'Bad Request',
headers:
{ date: 'Wed, 05 Feb 2020 11:33:48 GMT',
server: 'Apache/2.4.25 (Debian)',
'cache-control': 'no-cache, private',
'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET,POST,PUT,PATCH,DELETE',
'access-control-allow-headers':
'Content-Type,Authorization,sw-context-token,sw-access-key,sw-language-id,sw-version-id',
'sw-version-id': '',
'sw-language-id': '',
'sw-context-token': '',
'x-frame-options': 'deny',
'x-debug-token': 'bb4a50',
'x-debug-token-link': 'http://localhost:8000/_profiler/bb4a50',
'x-robots-tag': 'noindex',
connection: 'close',
'transfer-encoding': 'chunked',
'content-type': 'application/json' },
config:
{ adapter: [Function: httpAdapter],
transformRequest: [Object],
transformResponse: [Object],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
headers: [Object],
method: 'post',
url: 'http://localhost:8000/api/oauth/token',
data:
'{"scopes":"write","client_id":"administration","grant_type":"password"}' },
request:
ClientRequest {
_events: [Object],
_eventsCount: 6,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [Socket],
connection: [Socket],
_header:
'POST /api/oauth/token HTTP/1.1\r\nAccept: application/json, text/plain, /\r\nContent-Type: application/json;charset=utf-8\r\nUser-Agent: axios/0.18.1\r\nContent-Length: 71\r\nHost: localhost:8000\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/api/oauth/token',
_ended: true,
res: [IncomingMessage],
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable: [Writable],
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]: [Object] },
data: { errors: [Array] } } }
(node:25604) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
at Object.reindex (/home/pablo/Projects/storeFront/vsf-shopware-indexer/src/modules/attribute/service.js:19:47)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:25604) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:25604) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.