npm install #384
Profabiuls
started this conversation in
General
npm install
#384
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorry if I ask some obvious questions, but I'm a beginner.
I installed with npm and I have as dependency .
while setting type module in the html script it gives me this error:
Uncaught TypeError: Failed to resolve module specifier "@tarekraafat/autocomplete.js". Relative references must start with either "/", "./", or "../".
how can i go about solving?
html:
auto.js:
import autoComplete from "@tarekraafat/autocomplete.js";
const autoCompleteJS = new autoComplete({
selector: "#autoComplete",
placeHolder: "Search for Food...",
data: {
src: ["Sauce - Thousand Island", "Wild Boar - Tenderloin", "Goat - Whole Cut"],
cache: true,
},
resultsList: {
element: (list, data) => {
if (!data.results.length) {
// Create "No Results" message element
const message = document.createElement("div");
// Add class to the created element
message.setAttribute("class", "no_result");
// Add message text content
message.innerHTML =
<span>Found No Results for "${data.query}"</span>
;// Append message element to the results list
list.prepend(message);
}
},
noResults: true,
},
resultItem: {
highlight: true,
}
});
console.log("prova");
Beta Was this translation helpful? Give feedback.
All reactions