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

Unable to update shop name, Promise.await is not a function #4202

Closed
3 tasks done
nnnnat opened this issue Apr 20, 2018 · 11 comments
Closed
3 tasks done

Unable to update shop name, Promise.await is not a function #4202

nnnnat opened this issue Apr 20, 2018 · 11 comments
Assignees
Labels
bug For issues that describe a defect or regression in the released software

Comments

@nnnnat
Copy link
Contributor

nnnnat commented Apr 20, 2018

Prerequisites

  • Are you running the latest version?
  • Are you able to consistently reproduce the issue?
  • Did you search the issue queue for existing issue? Search issues

Issue Description

TypeError: Promise.await is not a function in browser console when saving updated shop name. I believe this same issue is effecting the product handle and possibly other fields in the UI.

Steps to Reproduce

  1. Start a fresh RC shop and log in to RC as a shop admin
  2. Open the shop panel, update the shop name and click the save button
  3. See that the button disables
  4. Close the shop panel and open it again
  5. See the shop name has been reset to "Reaction"

Possible Solution

I think this might be a regression from PR#4049.
Trying to lazy load the slugify/transliteration has been really tricky mainly because there are 3 versions of the same getSlug helper method. One that only runs on the server, one that only runs on the client and another that tries to run in both. It also seems that different parts of the UI use the different getSLug methods (tag nav is using getSlug from the client dir while shop name use the getSlug method inside of the lib dir).

I feel like there are two main issues to tackle

  1. Creating a getSlug method that:
    • takes a string as a param.
    • can resolve/await the lazy loading of slugify/transliteration.
    • returns the slugified string.
  2. Consolidating getSlug usage:
    • to a single getSlug method inside of lib that can be used by both server and client.
    • to a server and client versions of the method and change every import of the old lib version.

Versions

Node: 9.8.0
NPM: 5.8.0
Meteor Node: 8.9.4
Meteor NPM: 5.6.0
Reaction CLI: 0.29.0
Reaction: 1.11.0
Reaction branch: master
Docker: 18.03.0-ce
@nnnnat nnnnat added bug For issues that describe a defect or regression in the released software impact-critical labels Apr 20, 2018
@tizzle
Copy link

tizzle commented May 10, 2018

I'm experiencing the same problem when trying to change e.g. timezone in localization/i18n settings.

@mikepuglisi
Copy link

Same Problem. Fresh install on linux mint using the reaction-cli and I can't update the store name without receiving the Promise.await is not a function javascript error.

@JacobGadawski
Copy link

Hi, I have same problem. I create new reaction project on fresh linux mint and I can't update store and localisation settings.

@loanlaux
Copy link

Same issue here. I have a client's multi-vendor marketplace which can't onboard new users due to that issue. As you can imagine, that's pretty critical.

Is there a quick fix one can apply while waiting for the official patch?

@nnnnat
Copy link
Contributor Author

nnnnat commented May 12, 2018

@loanlaux One thing you could try for a temporary fix is to remove the dynamic import for the slugify / transliteration packages in the lib/api/helpers.js file and just import the one you need at the top of the file. import { slugify } from "transliteration"; or import slugify from "slugify"; if you're only supporting latin based chars. You'll also need to remove the Promise.await in the same file.

@loanlaux
Copy link

Thanks @nnnnat, I did exactly this and will stand by until it's officially fixed!

@Marcosul
Copy link

Marcosul commented May 15, 2018

Hello, the same problem is occurring for me.

Note: I have two RC applications. These problems only occur in the application that I installed the REST API (simple: rest) and I created a new container in development environment, and pulled into production.

In the application I installed directly without creating a new container, it's working

Thank you.

@striletskyy
Copy link

@loanlaux didn't work for us so far. Any other solutions?

@nonfungibletunji
Copy link

I am on the latest 1.12.0 and still cannot change shop name, from the admin

@JacobGadawski
Copy link

Same here, nothing's change in new version...

@jamesporl
Copy link
Contributor

I'm closing this as this is fixed in v1.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software
Projects
None yet
Development

No branches or pull requests

9 participants