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

Uncaught TypeError when <base> tag doesnt have a href attribute #19038

Closed
emattias opened this issue Jul 7, 2020 · 1 comment · Fixed by #19059
Closed

Uncaught TypeError when <base> tag doesnt have a href attribute #19038

emattias opened this issue Jul 7, 2020 · 1 comment · Fixed by #19059
Labels

Comments

@emattias
Copy link

emattias commented Jul 7, 2020

In storybook I get this error

Uncaught TypeError: Cannot read property 'replace' of null

on this line

because baseUrl is null and not a string like it look like that line is assuming.

The base tag looks like this (from here):

<base target="_parent">

solution suggestions

Would it work to change this line

to

      baseURL = base.getAttribute('href') || '';

or is there a problem with setting baseUrl to ''?

@rwjblue
Copy link
Member

rwjblue commented Jul 26, 2020

Hmm, I think the more appropriate solution here would be to treat having a <base> without an href as having no <base> at all. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants