Meteor build error "Cannot find module"


#1

I have a meteor application that I am running fine on my computer. As one of my colleagues are now going to help on the project I am trying to get him set up for development too.

Note: We are a windows .Net development shop, so, yes - we are using Windows… Because of other projects we are doing this is, realistically, the best option for us.

Anyway. We are using meteor 1.4.1.1 for our application (using React UI). Like I said, it works on my computer, but not on his. We have tried everything, including re-installing meteor (from download or using upgrade command-line options), deleting node_modulesand .meter/local. We have tried to shorten the path so that it is shorter than on my computer. We tried to npm install --global --production windows-build-tools. A fresh default meteor application works fine though, so it seems to be related to the extra packages that we have added, possibly then the css-modules package or it’s dependencies - maybe… We have even tried a full copy of my working copy, but nothing helps. It always fails with the same error:

/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Processing Step: Babel compilation
Unable to compile imports/custom/components/Clock/Clock.mss
Error: Cannot find module './data/character-class-escape-sets.js'
Source: 
// <start of file>
import modules from 'meteor/modules';
modules.addStyles("._imports_custom_components_Clock__Clock__root{\r\n    text-align: left;\r\n}\r\n\r\n/*# sourceMappingURL=Clock.mss.map */");
const styles = {"root":"_imports_custom_components_Clock__Clock__root"};
export { styles as default, styles };
// <end of file>

/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As you can see, we have included CSS modules (which is really cool - and working on my computer and some others we have tried it on). However, not on the computer for this colleague of mine. If we remove the .mss file that ‘causes’ the problem then it just fails on the next mss file.

I have tried to google this but can’t find any information that gives us an idea on how to fix this. I am including a screenshot of the log-file (since the forum does not allow tekst-files to be uploaded). The log was generated with SET METEOR_DEBUG=1 to get as much information as possible.

Have anyone ever had similar issues and/or have suggestions on how to fix this?

Note: I have registered an issue in the github repo for css-modules too, hoping that any of the users there can assist: https://github.com/nathantreid/meteor-css-modules/issues/69


#2

On his machine we were able to recreate this with a minimum amount of steps.

  1. Run meteor create demo
  2. cd demo
  3. Add nathantreid:css-modules to the .meteor/packages file
  4. Run meteor

The same error message as above is shown (without the initial error message related to the inclusion of a .mss file in the linked to log).

Could this be a Windows “path too long” issue?

It is a bit strange though, that it happens only on his Windows 10 installation, and not on my Win 10 installation.


#3

I’m seeing the same issue on my Windows 10 machine - I don’t have a solution, but I posted it on the nathantreid/meteor-css-modules github to hopefully get a response from the expert.


#4

I just tracked down a hacky fix to this, which I described here: https://github.com/nathantreid/meteor-css-modules/issues/71#issuecomment-252534966