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

Not able to load web-component based Javascript file #1046

Open
nikhilatkan opened this issue Feb 15, 2023 · 1 comment
Open

Not able to load web-component based Javascript file #1046

nikhilatkan opened this issue Feb 15, 2023 · 1 comment

Comments

@nikhilatkan
Copy link

I want to embed a javascript file but not able to load it on the project.

Tried this,
const view = (state, {updateState}) => {

function AddLibrary(urlOfTheLibrary) {
	console.log("add librar",urlOfTheLibrary);
	const script = document.createElement('script');
	script.src = urlOfTheLibrary;
	document.head.appendChild(script);
  }

return (
	<div>
		<div>Hello</div>
		<sg-bar hook-init={AddLibrary("/sg-bar.js")}></sg-bar>
	</div>
);

};

Also it is not able to find that specific javascript file in the dist folder after building.

@iambumblehead
Copy link
Contributor

To a lurker, this issue is difficult to understand. Multiple un-related problems are mentioned; web-component-based file problems, embedding and loading problems, web-serving problems and application building problems. The code block is incorrectly placed in the markdown, and snabbdom is not demonstrated anywhere.

Politely, I recommend closing this issue or editing it to clearly describe a problem related to snabbdom

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

2 participants