In this post, we will see how to resolve Why home is not defined?
Question:I am not sure why home is not defined when i do this in app.js? I tried to reference home.js with app.js by adding code
Is that reference enough and should i focus my self to solve the second one error?
Best Answer:Please check the MDN Docs about import
Fixing it for HTML
To fix the problem for HTML scripts, you need to set the element’s type attribute to specify the type of script included in the element.
This will allow you to use import statements within the script.
Here is an example:
If you have better answer, please add a comment about this, thank you!