lucide
lucide copied to clipboard
vanilla js createElement not working on 0.475.0
Package
- [x] lucide
- [ ] lucide-angular
- [ ] lucide-flutter
- [ ] lucide-preact
- [ ] lucide-react
- [ ] lucide-react-native
- [ ] lucide-solid
- [ ] lucide-svelte
- [ ] lucide-vue
- [ ] lucide-vue-next
- [ ] Figma plugin
- [ ] source/main
- [ ] other/not relevant
Version
0.475.0
Can you reproduce this in the latest version?
- [x] Yes
- [ ] No
Browser
- [x] Chrome/Chromium
- [ ] Firefox
- [ ] Safari
- [ ] Edge
- [ ] iOS Safari
- [ ] Opera
- [ ] Other/not relevant
Operating system
- [x] Windows
- [ ] Linux
- [ ] macOS
- [ ] ChromeOS
- [ ] iOS
- [ ] Android
- [ ] Other/not relevant
Description
Using the following snippet from the documentation:
import { createElement, Menu } from 'lucide';
const menuIcon = createElement(Menu); // Returns HTMLElement (svg)
// Append HTMLElement in webpage
const myApp = document.getElementById('app');
myApp.appendChild(menuIcon);
I encounter the error:
lucide.js?v=34a07901:7 Uncaught (in promise) InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('line,[object Object]') contains the invalid character ','.
Temp fix: Downgrading from lucide v0.475.0 to v0.474.0 resolves the issue.
Steps to reproduce
-
install 0.475.0
-
run snippet
-
see error message
-
install 0.474.0
-
run snippet
-
icon appears correctly
Checklist
- [x] I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)