gotofig2 Posted September 30, 2020 Share Posted September 30, 2020 Hi I wonder if anyone can shed light on this for me. I (intermitantly) find the line: const { default: gsap } = require("gsap/gsap-core") added to line 1 of my main.js code in vscode. Does this mean that it does not have access to the GSAP library? I am linking to the cdn in my html as follows: <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/ScrollTrigger.min.js"></script> <script src="main.js"></script> </body> </html> Link to comment Share on other sites More sharing options...
ZachSaucier Posted September 30, 2020 Share Posted September 30, 2020 5 hours ago, gotofig2 said: I (intermitantly) find the line: const { default: gsap } = require("gsap/gsap-core") added to line 1 of my main.js code in vscode. It sounds like someone is sneaking into your office and adding it Kidding. But if you're using regular HTML files and are loading GSAP like that (i.e. not as a module) that doesn't make sense why VS Code would be adding it. It still works if you remove it, right? Maybe you could ask in a VS Code forum somewhere. 1 Link to comment Share on other sites More sharing options...
Dipscom Posted September 30, 2020 Share Posted September 30, 2020 VS Code has some magic in it and it will add import/require declarations on top of your files if it thinks you need/want some. 1 Link to comment Share on other sites More sharing options...
gotofig2 Posted October 3, 2020 Author Share Posted October 3, 2020 Thanks for your reply. the weird thing is that my code is broken until I delete it! Not very useful... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now