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.

`SafeString` is "private"

See original GitHub issue

Which package(s) does this problem pertain to?

What are instructions we can follow to reproduce the issue?

There is no public re-export of SafeString, which is the return type of htmlSafe. If you have a function or getter that returns the result of calling htmlSafe, the return type is “unnamable”. There are workarounds, like RetrunType<typeof htmlSafe>, but 😬

Reproduction Case
import { htmlSafe } from '@ember/tempalte';

export function myFunc(str: string): ??? {
  return htmlSafe(str);
}

Now about that bug. What did you expect to see?

Something I can import to fill in the ???.

What happened instead?

There is nothing I can import to fill in the ???.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
chancancodecommented, Jun 2, 2020

(By the way, the issue templates are missing @types/ember__template)

1reaction
boris-petrovcommented, Jun 21, 2020

I actually use import { SafeString } from 'handlebars'; and that seems to work. But I also use import { htmlSafe } from '@ember/string'; which is different from import { htmlSafe } from '@ember/tempalte';… in some way? Not sure why that function is exported from two different packages. Is it different in some way?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The SafeString alternative to Arduino Strings for Beginners ...
This SafeString library is designed for beginners to be a safe, robust and debuggable replacement for string processing in Arduino. This ...
Read more >
Using the SafeString library - Arduino Forum
This topic is open to questions about how to apply my SafeString library to particular cases. (The SafeString library can be installed from ......
Read more >
Making a Java SafeString that works with all unicode characters
John Shepard shows us how to write a safe string that supports all unicode characters. ... private String testString = new StringBuilder().
Read more >
SafeString Alternative to Arduino Strings for Beginners
1. Installation of SafeString library: SafeString is now available via the Arduino Library Manager, thanks to Va_Tech_EE Start the Arduino IDE, open the ... 2....
Read more >
'SafeString' object has no attribute 'get' - Stack Overflow
def your_function(request): ......# your queries context = { 'order': order,'ordered_items': ordered_items,'change': change} html ...
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