I want to use threejs with wordpress cany anybody tell a step by step way to do so?
I got a way to include js in wordpress but unable to import threejs error showing cannot use import outside module
It is great mistake you did with code placement.
You are trying to use ES Module features or syntax in es5. So, it's throw error
Cannot use 'import or export' like syntax outside Module.
If you code has import and export like syntax it must be ES Module.
So add type=module attribute to script
<script type="module" src="./file/url.js"></script>