Skip to content
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

[v2.0.0] Create a new channel #2217

Closed
oidt opened this issue Jun 9, 2023 · 9 comments
Closed

[v2.0.0] Create a new channel #2217

oidt opened this issue Jun 9, 2023 · 9 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@oidt
Copy link
Contributor

oidt commented Jun 9, 2023

Describe the bug
I try to create a new channel but nothing happens.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Settings -> Channels'
  2. Click on 'Create new channel'
  3. Fill in the form
  4. When I click on 'Create' nothing happens.

Expected behavior
I expect to have a new channel with my settings in the form

Environment (please complete the following information):

  • @vendure/core version: v2.0.0
  • Nodejs version: v18.14.0
  • Database (mysql/postgres etc): mysql/sqlite

Additional context
In the chrome developer tab I do see this but sure if it is related.

DevTools failed to load source map: Could not load content for http://localhost:3000/admin/settings/channels/action-bar.component.ts-angular-inline--1.css.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

@oidt oidt added the type: bug 🐛 Something isn't working label Jun 9, 2023
@patrickalima98
Copy link
Contributor

Hi, the same to me

@nonlinearcom
Copy link

hi, same here, in my case the error message shows:
ERROR ApolloError: null value in column "defaultCurrencyCode" of relation "channel" violates not-null constraint

@patrickalima98
Copy link
Contributor

@nonlinearcom the same to me when use GraphQL Api:

mutation CreateChannel {
    createChannel(
        input: {
            code: "Test",
            token: "clipdmi57000008jv4if664do",
            defaultCurrencyCode: BRL,
            trackInventory: true,
            pricesIncludeTax: false,
            sellerId: "1",
            defaultTaxZoneId: "5",
            defaultShippingZoneId: "5",
            defaultLanguageCode: en,
            availableCurrencyCodes: [BRL]
        }
    ) {
        ... on LanguageNotAvailableError {
            errorCode
            message
            languageCode
        }
        ... on Channel {
            id
            createdAt
            updatedAt
            code
            token
            defaultLanguageCode
            availableLanguageCodes
            currencyCode
            defaultCurrencyCode
            availableCurrencyCodes
            trackInventory
            outOfStockThreshold
            pricesIncludeTax
            customFields
        }
    }
}

Server response:

image

@nonlinearcom
Copy link

@patrickalima98 I managed to create a channel with the following mutation, using currencyCode instead of defaultCurrencyCode :

mutation CREATECHANNEL {
	createChannel(
		input: {
			code: "test"
			token: "test"
			defaultLanguageCode: en
			availableLanguageCodes: [en]
			pricesIncludeTax: true
			currencyCode: EUR
			availableCurrencyCodes: [EUR]
			trackInventory: true
			defaultTaxZoneId: 2
			defaultShippingZoneId: 2
		}
	) {
		code
	}
}

@patrickalima98
Copy link
Contributor

@nonlinearcom thanks for you reply.

I can confirm, it worked here too

@oidt
Copy link
Contributor Author

oidt commented Jun 13, 2023

@michaelbromley It still goes wrong when not flipped: Prices include tax for the default Zone

Not working:
image

Working:
image

@habibullahturkmen
Copy link

I'm facing the same issue with Vendure 2.0.1. It works when "Prices include tax for the default Zone" is flipped on.

@michaelbromley
Copy link
Member

actually_fixed_v2_2-final.psd coming soon!

@serbyxp
Copy link

serbyxp commented Aug 3, 2023

Im getting this

everything works.. im not sure if this has to do with the graphQL Playground or whatever that is
like if i go in the browser to http://storefront/ I get the error below
but then If i go to http://vendure/shop-api .. or /admin-api I See a "UI" for messing around with the GraphQL... Which would be returning the <!DOCTYPE ... HTML etc for that playground? UI?
so im not sure if thats even where this error is happening seeing as Im going to http://storefront/ ... but Im assuming that the storefront is making an API request to the vendure api ( they both on same docker network and it works ... and I changed the readonly.vendure.io in the settings thats when things broke

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)
    at successSteps (node:internal/deps/undici/undici:6636:27)
    at node:internal/deps/undici/undici:1236:60
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
{"level":50,"time":1691104383569,"pid":1,"hostname":"d48a5d0abab8","reqId":"req-5","err":{"type":"TypeError","message":"Cannot read properties of undefined (reading 'Symbol(pino.msgPrefix)')","stack":"TypeError: Cannot read properties of undefined (reading 'Symbol(pino.msgPrefix)')\n    at LOG (/usr/src/app/node_modules/pino/lib/tools.js:59:22)\n    at router (file:///usr/src/app/server/entry.fastify.js:18:11571)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.<anonymous> (file:///usr/src/app/server/entry.fastify.js:18:12528)"},"msg":"Promise errored, but reply.sent = true was set"}
{"level":30,"time":1691104383571,"pid":1,"hostname":"d48a5d0abab8","reqId":"req-5","res":{"statusCode":500},"responseTime":243.1947959959507,"msg":"request completed"}


** I turned the playground off ( the /shop-api) doesnt show the HTML playground anymore, but the error <!DOC .. still there

... but it does return ' GET query missing. '
I know im not sending it anything when I use the browser but the other / return the default browser JSON format not this HTML looking thing .. even though when in devtools it says its in "Qwirks mode" since <!DOCTYPE is not there.. so I mean I dont know why the error still happens when i go to storefront/

@michaelbromley michaelbromley moved this to ✅ Done in Vendure OS Roadmap Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

6 participants