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

htmlSafe function not available in @ember/string but only in fastboot #855

Closed
mansona opened this issue Aug 29, 2021 · 4 comments
Closed

Comments

@mansona
Copy link
Member

mansona commented Aug 29, 2021

When running in fastboot we get an error TypeError: (0 , _string.htmlSafe) is not a function but running the same app in the browser doesn't have the same issue.

I have noticed this issue with the Ember Blog https://github.com/ember-learn/ember-blog and when debugging I can confirm that the object that is injected in place of @ember/string does indeed not have the htmlSafe function.

In Fastboot:

Screenshot 2021-08-29 at 07 12 28

The exact same code in the browser:

Screenshot 2021-08-29 at 07 14 04


Something else that is odd with this error is that it is a "caught error". For me to hit it in the debugger I had to select "Pause on caught exceptions". It also doesn't register as an error when doing a Prember run which means that we have not been Fasbooting the Ember blog for a while now and we just didn't notice 🙈

I know this is a known deprecation and with Ember 4.0 it is pretty urgent to fix as quickly as possible but I'm surprised that this is broken in fastboot and working in the browser 🤔

@hoIIer
Copy link
Contributor

hoIIer commented Feb 7, 2022

@mansona did you ever figure this out? I'm seeing same thing after updating deps

@st-h
Copy link

st-h commented Feb 26, 2023

I have experienced something similar, however in my case it was merely triggering a deprecation. And I was only seeing it in the browser, but not on the fastboot server. While trying to find a solution, someone suggested this issue: emberjs/ember-string#235 (comment)

essentially there are competing implementations in ember-source and @ember/string and it looks like nobody knows when which one will be used and under what circumstances.

possibly this issue will also fix that emberjs/ember.js#20383

@kategengler
Copy link

v5.0 of ember-source removes the internal implementation of @ember/string, so yes, it should be fixed then.

v3.0.1 of @ember/string added htmlSafe method that errors and explains what needs to change. I suspect this can be closed.

@mansona
Copy link
Member Author

mansona commented Apr 6, 2023

Yes I think this can be closed too 👍

@mansona mansona closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants