Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript Course: Adding note about template literals on import statements #28049

Closed
3 tasks done
aceus0 opened this issue May 24, 2024 · 3 comments · Fixed by #28051
Closed
3 tasks done

JavaScript Course: Adding note about template literals on import statements #28049

aceus0 opened this issue May 24, 2024 · 3 comments · Fixed by #28051
Assignees

Comments

@aceus0
Copy link
Contributor

aceus0 commented May 24, 2024

Checks

Describe your suggestion

ES6 Modules

As someone who uses template literals (`) more than I problably should, I attempted to write my first import statement using them, which left me trying to figure out why I couldn't run npx webpack sucessfully.

That said, i'd like to add a little note box, perhaps like the one on the Factory Functions lesson, that mentions that template literals can't be used for import/export statements, and to stick to quote or double quote for import/export.

Lessons in Foundation don't inform that template literals have things they can't do over other string declarations, in fact the MDN doc that first introduces them only lists that they are better than other string declarations. But that might be for another day.

For now I'd like to add a small note about them in the ES6 Modules Lesson. I'd be happy to work on it.

Path

Node / JS

Lesson Url

https://www.theodinproject.com/lessons/node-path-javascript-es6-modules

(Optional) Discord Name

aceus_

(Optional) Additional Comments

First Issue and possible first contribution!

@MaoShizhong
Copy link
Contributor

Thanks for opening this issue @aceus0.
The MDN docs for import do state that you can only use single or double quotes for the module name (i.e. no template literals). I'm not opposed to a quick note in the current lesson though reinforcing that, perhaps best as an additional comment to the following code block:

image

How does that sound to you?

@aceus0
Copy link
Contributor Author

aceus0 commented May 25, 2024

@MaoShizhong, sure that sounds good. Just want to help others avoid this pitfall!

I'll get working on it today.

@MaoShizhong
Copy link
Contributor

Awesome. When I get the chance, I can pop a similar note in #27953. Wouldn't hurt to just be explicit about it for clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants