prejss icon indicating copy to clipboard operation
prejss copied to clipboard

App crashing when importing prejss: Module not found require-from-string

Open Vadorequest opened this issue 6 years ago • 3 comments

I'm running into a very weird issue when npm i -S prejss and then use import preJSS from 'prejss'; in my project, the compilation fails with:

Failed to compile.

./node_modules/require-from-string/index.js
Module not found: Can't resolve 'module' in '/Users/vadorequest/dev/student-loan-simulator/node_modules/require-from-string'

Isn't that a missing dependency?

I tried to install it npm install --save require-from-string but then another compilation error:

Failed to compile.

./node_modules/cosmiconfig/node_modules/require-from-string/index.js
Module not found: Can't resolve 'module' in '/Users/vadorequest/dev/student-loan-simulator/node_modules/cosmiconfig/node_modules/require-from-string'

If I remove import preJSS from 'prejss'; then it compiles correctly.

Vadorequest avatar Feb 07 '18 13:02 Vadorequest

May be related to https://github.com/facebook/react-native/issues/4968 and not to prejss at all. (TL;DR; npm cache messing things up)

Hard to debug, hard to tell. Haven't tried again.

Vadorequest avatar Feb 08 '18 13:02 Vadorequest

@Vadorequest Did you find a solution to the problem? I'm running into the same issue, tho using Yarn.

dforsl avatar Apr 05 '18 20:04 dforsl

@dforsl it may be due to installing packages with different version of npm/yarn, like for instance I may have had installed part of my package using 8.10 and prejss with 6.10 or something like that.

Deleting and reinstalling node modules may help, or not. I don't remember what I did with prejss and I've moved on since

Vadorequest avatar Apr 06 '18 07:04 Vadorequest