1

I try using OnsenUI2 React version in Meteor.js and create a simple demo app. My full project source exist here: https://github.com/MeteorDemoApps/OnsenUI2React-demo

I don’t know why but when I add import demoIconIndex from './demo/Icon/Index.jsx'; to my TOC component, my app return Error: Cannot find module './demo/Icon/Index.jsx' and break at all but this file exist in same path.

I also double check anything. What is the problem?

b24
  • 2,425
  • 6
  • 30
  • 51
  • 1
    It is probably some kind of stupid mistake, but I don't see it either. This may not sound very advanced but I would actually suggest that you copy your `demoFABIndex` component to something like `./demo/FAB2/Index.jsx` and then modify that to `./demo/Icon/Index.jsx` step by step in order to see which change breaks the system. – Ilia Yatchev Aug 18 '16 at 13:52
  • @ilia-yatchev I did a lot of test and find that if `Icon` word exist in path app breaks but If I rename file to `Icons` and change my import to `./demo/Icons/Index.jsx` all things works well. Is `Icon` has a special or reserved word in ES6 or OnsenUI 2 ? – b24 Aug 23 '16 at 13:53
  • hmm this sounds really strange. I don't think it has any special meaning in either ES6 or Onsen 2, so I don't know where exactly the problem may come from. I would guess that it still comes somewhere from your project, but I am not sure from where. I haven't used react much, but I guess for now the easiest solution would be to rename it to icons. Yet another thing you could try is cloning the project but step by step where you include your `Icon/Index.jsx` from the beginning and add the other files, but since it may be a lot of work I don't know if it's worth it. – Ilia Yatchev Aug 23 '16 at 14:45
  • Also even if `Icon` had some special meaning in either it wouldn't affect anything when being part of a string. In theory something like an empty (invisible) character or one from another alphabet (such as a Cyrillic `о`) could cause such an issue, but it definitely sounds like a problem specific to your project. If you create an empty project and include a file from "./demo/Icon/Index.jsx" I doubt it will be a problem. I am not sure if debugging this is beneficial though since it sounds like it may take a lot of resources and doesn't sound very helpful in the future. Anyway good luck! – Ilia Yatchev Aug 23 '16 at 14:49

0 Answers0