question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heading text sets throwing error

See original GitHub issue

Select any heading text set, drop to story editor canvas, editor crash

Error Stack

t.startsWith is not a function
    at l (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/styleManipulation.js:34:23]()
    at l (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/styleManipulation.js:35:12]()
    at eval (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/styleManipulation.js:41:32]()
    at o (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/styleManipulation.js:41:13]()
    at isBold (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/formatters/weight.js:51:69]()
    at eval (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/getStateInfo.js:22:20]()
    at eval (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/getStateInfo.js:20:47]()
    at t (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/getStateInfo.js:16:25]()
    at u (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/richText/htmlManipulation.js:60:24]()
    at eval (https://4216o9.csb.app/node_modules/
[googleforcreators/story-editor/dist-module/components/panels/design/textStyle/useRichTextFormatting.js:74:6]()

Steps to Reproduce

https://codesandbox.io/s/fervent-dawn-4216o9

Screenshots

Additional Context

  • Plugin Version:
  • WordPress Version:
  • Operating System:
  • Browser:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

2reactions
swissspidycommented, Feb 21, 2022

Ah, good find! Totally forgot about our custom patches when thinking about decoupling.

We definitely need to handle these somehow.

For react-photo-gallery there might be a replacement package, see #10444

For the draft-js-import-element package — which the other patch is for — I can’t find a good alternative right now. So I’lll probably just go ahead and fork it for our use case. There might be no need to publish that on npm, we could just reference it from GitHub.

Tangent: unfortunately just like the draft-js-import-element package, draft-js itself isn’t really maintained anymore. Facebook is even working on a new rich text editor instead (see https://twitter.com/trueadm/status/1472377356044099587). Long term we need to look for a replacement. For example Slate.

1reaction
swissspidycommented, Feb 23, 2022

Ticket created for Draft.js: #10684

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Can't set headers after they are sent to the client
A Can't set headers after they are sent error message will be thrown because res.json() is called twice, meaning two responses are sent....
Read more >
How to Troubleshoot and Fix Excel Pivot Table Errors
The pivot table error, "field name is not valid", usually appears because one or more of the heading cells in the source data...
Read more >
Error handling - Apollo GraphQL Docs
Throwing errors ​​ For example, it throws a GRAPHQL_VALIDATION_FAILED error whenever an incoming operation isn't valid against the server's schema. Your resolvers ...
Read more >
Dealing with errors - Power Query | Microsoft Learn
Power Query is unable to find a column heading named Column, so it can't rename any columns. It displays the error shown in...
Read more >
Common error messages in Data Loader - Salesforce Help
Cause: There is data in a field that does not have a header to map. Resolution: Review each column and ensure a header...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found