Typeahead import with Vite fails in production mode #58
-
Hi :) (Sorry, beginner here.) I seem not to be able to use it with vite, but I am not sure what I am doing wrong. I probably have a simple vite issue, but maybe not (minimal example below). I have another webcomponent which works fine, and other dependencies in the same project also do not cause issues. So I wonder if typeahead-standalone has certain requirements? The error only occurs in production build when using it in a script tag in a HTML file (error from the example described below):
Minimal example can be created like this:
Any ideas? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hello @Pfeil , thank you for reporting this with details instructions. Will check this and get back with a fix, if necessary. Good day |
Beta Was this translation helpful? Give feedback.
-
This answer makes no sense. It looks like you are asking for us to package our own version of typeahead to work with vite? Each time a new version comes out we will need to repackage this? |
Beta Was this translation helpful? Give feedback.
Hello once again @Pfeil, after following the steps you gave, I realised that you are not using the correct built version. you must use the ESM version. Here's a repository where you can see that typeahead-standalone works as expected -> https://github.com/niketpathak/typeahead-standalone-vite.