Skip to content

Import warnings #1708

Discussion options

You must be logged in to vote

I do not see those issues anymore when creating a new app with of the latest nuxt template:

I've loaded older next project and the error messages about importing from tw-elements and document not defined were still there. What worked for me was changing the imports to dynamic imports inside the useEffect method.

  useEffect(() => {
    const init = async () => {
      const { Datepicker, Input, initTE } = await import("tw-elements");
      initTE({ Datepicker, Input });
    };
    init();
  }, []);

Please give it a try and let me know whether it helped or not.

Best Regards!

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by filipkappa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants