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

Fixed Failed Transliteration Import showing blank screen on IE11 #2545

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/api/helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import url from "url";
import { slugify } from "transliteration";
import "transliteration/lib/browser/transliteration.js";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've introduced a linting error there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also what's causing the tests to fail

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might need to do something like this (this is what was there in a previous incarnation)

if (Meteor.isServer) {
  import { slugify } from "transliteration";
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of that is working. It looks like this has fixed the problem on the clients-side but broken it on the server-side.

I'm getting this error on the server-side whenever I start and it's also what is failing the tests

  TypeError: _slugify is not a function
      at _getSlug (lib/api/helpers.js:86:27)
      at Object.autoValue (lib/collections/schemas/products.js:467:9)
      at Object.runAV (packages/aldeed_simple-schema.js:1282:26)
      at packages/aldeed_simple-schema.js:1383:13
      at Array.forEach (native)
      at Function._.each._.forEach (packages/underscore.js:139:11)
      at packages/aldeed_simple-schema.js:1382:7

adding in any import for the server causes the client-side to fail again. I am convinced that dzcpy/transliteration#38 is related. We might want to pull in dzcpy/transliteration#44 and see if that fixes it.

import { Meteor } from "meteor/meteor";
import { Router } from "/imports/plugins/core/router/lib";
import { Shops } from "/lib/collections";
Expand Down
4 changes: 3 additions & 1 deletion server/api/core/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { slugify } from "transliteration";
// import { slugify } from "transliteration";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are going to remove this, let's remove it, not comment it out.

import { slugify } from "transliteration/lib/browser/transliteration.js";


/**
* getSlug - return a slugified string using "slugify" from transliteration
Expand Down