If you do not precede the path with a backslash
If you start with a name, your browser will assume that what you want is in the current directory.
You have to think about old school, where everything was based on folders.
So if your url is myhost.com/postse
you ask js/scriptname.js
, your browser asks myhost.com/js/scriptname.js
because you're thinking that you mean that js is in the same folder as the posts.
The problem then comes when you're in the myhosts.com/posts/my-favourite-post
folder because your browser will attempt to load myhost.com/posts/js/scriptname.js
because it thinks js is in the current folder.
on the other hand
If you start your resource path with a slash, that is /js/scriptname.js
, the browser assumes that the js folder is outside the root folder - no matter how many folders you are in the URL
simplifying. just start with slash your import code
<script src="{{ asset('assets/js/formCurriculo.js') }}" type="text/javascript" async="true" defer></script>