Webpack error with react

后端 未结 2 2394
北海茫月
北海茫月 2021-02-20 16:34

I am trying to configure webpack according to this tutorial and keep getting the same error. I am having trouble debugging these 2 messages:

ERROR in ./app.js
M         


        
2条回答
  •  爱一瞬间的悲伤
    2021-02-20 17:30

    When I was importing with the syntax

    import Component from './components/component';
    

    I was getting the module parse error. To fix it, I had to specify .jsx and it worked

    import Component from `./components/component.jsx`. 
    

    It wasn't a config error at all. I'm on babel 6 with hot loader.

提交回复
热议问题