That isn’t valid JS, imports have to be fully qualified:
import { test } from './module/animal.js';
And yeah,
<script src="index.js" type="module"></script>
Is mandatory.
Side issue re above post, it doesn’t have to be anywhere specific, can be in head or body, once you add type=“module” the script is automatically deferred, the advice there doesn’t really apply.
Thank you so much for the help everyone! I’ve been learning javascript and web development mostly on my own and have run into headaches that have taken me a while to figure out. Having a great community like this to be part of is making me so excited to continue on my journey!