freeCodeCamp: Show warning to users when they try to source the wrong files

Is your feature request related to a problem? Please describe.

When a user tries to source style.css (rather than styles.css) this fails silently. Similarly, sourcing anything other than script.js will result in a rather cryptic error: Uncaught SyntaxError: Unexpected token '<'.

This is needlessly frustrating.

Describe the solution you’d like

The console should show a helpful warning. For example

You have tried to source style.css, but that does not exist. The only files that can be sourced are styles.css and script.js.

Describe alternatives you’ve considered

Nothing comes to mind.

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

Alternative

The tests be in charge of this, as this is only likely to come up in specific lessons (first few + cert projects).

I do not like the idea of the console/editor behaving extra different compared to an actual console/editor. That is, I would prefer the Uncaught SyntaxError... be fixed over providing a very specific warning.