Skip to content

Cannot find module #1233

Answered by lordelogos
liydaco asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @liydaco,

Summary:
The issue is with node and jsx files
Solution in this repo.

  • Clone the repo
  • Update the api keys
  • Run with yarn dev

Explanation

Node js by default doesn't work with es6 imports and jsx files out of the box. There has to be some configuration to get them to work. By far the most popular way is to setup Babel.

A bit on Babel

Babel is a powerful JavaScript compiler and when it comes to using JSX with ES6 imports in Node.js, Babel plays a significant role in transpiling JSX and handling ES6 modules.

Once we setup babel and the configuration, we can now transpile our code to a format that node can understand and run with no hassle.

I hope this helps you!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by gabrielmfern
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Type: Bug Confirmed bug
3 participants
Converted from issue

This discussion was converted from issue #875 on January 23, 2024 13:30.