0

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

1 Answer 1

0

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.