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

img-redundant-alt warning bug (Breaking) #4770

Closed
dogagenc opened this issue May 3, 2020 · 2 comments · Fixed by #4771
Closed

img-redundant-alt warning bug (Breaking) #4770

dogagenc opened this issue May 3, 2020 · 2 comments · Fixed by #4771

Comments

@dogagenc
Copy link
Contributor

dogagenc commented May 3, 2020

Describe the bug
alt attributes with expressions on image elements returns null for static value, but new commit for img-redundant-alt warning checks it as a string.

153b128#diff-8e6b4a7e9c9ba91db066af615305f5f4R491

This breaks whole build process.

Logs
Build log:

[!] (plugin svelte) TypeError: Cannot read property 'match' of null
 src/components/SourcesBar.svelte
 TypeError: Cannot read property 'match' of null
     at Element$1.validate_special_cases (node_modules/svelte/src/compiler/compile/nodes/Element.ts:491:19)
     at Element$1.validate (node_modules/svelte/src/compiler/compile/nodes/Element.ts:275:8)
     at new Element$1 (node_modules/svelte/src/compiler/compile/nodes/Element.ts:220:8)
     ...

To Reproduce
https://svelte.dev/repl/1b24eb90a2bf4b1fbcbc1250b80aecbb?version=3.22.0

Expected behavior
Skip check if alt value is not string or falsy. (null in this case)

Information about your Svelte project:

  • Tested on e.x. OS X 10.14, Ubuntu Linux 19.10

  • Svelte version: 3.22.0

  • Whether your project uses Webpack or Rollup: Rollup

Severity
BREAKING!

Additional context
I'm sending PR soon!

@dogagenc dogagenc changed the title img-redundant-alt warning bug img-redundant-alt warning bug (Breaking) May 3, 2020
@Conduitry
Copy link
Member

Thank you for your quick fix! Released in 3.22.1 - https://svelte.dev/repl/1b24eb90a2bf4b1fbcbc1250b80aecbb?version=3.22.1

@mustafa0x
Copy link
Contributor

Empty alt is also broken — see #4777.

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

Successfully merging a pull request may close this issue.

3 participants