Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Can't resolve 'module' in '/Users/Documents/git/project-name/node_modules/require-from-string' #25

Closed
jpdorsy opened this issue Mar 21, 2018 · 4 comments

Comments

@jpdorsy
Copy link

jpdorsy commented Mar 21, 2018

Environment: create-react-app (forked https://www.npmjs.com/package/custom-react-scripts)

Code change:
// import gql from 'graphql-tag';
import { gql } from 'graphql.macro';

Problem: Switching to use graphql.macro from graphql-tag throws following error:

Failed to compile.

./node_modules/require-from-string/index.js
Module not found: Can't resolve 'module' in '/Users/Documents/git/fwota-ui/node_modules/require-from-string'
@evenchange4
Copy link
Owner

evenchange4 commented Mar 22, 2018

Hi @jpdorsy, thank you for reporting it.
Unfortunately, I can not reproduce it. Would you like to provide more information?
Here is a simple demo of the gql use case.

@jpdorsy
Copy link
Author

jpdorsy commented Mar 22, 2018

Thanks, your demo contains [email protected]. Does the graphql.macro work in [email protected]?

@evenchange4
Copy link
Owner

No, the graphql.macro does not work with 1.x. :(
The Babel Macros solution is only supported in 2.0.

@jpdorsy
Copy link
Author

jpdorsy commented Mar 22, 2018

If graphql.macro only supports 2.x.x, as per this link (facebook/create-react-app#3909) isn't the .graphql file support already added to 2.x.x? Do we still need graphql.macro in that case? thanks.

@jpdorsy jpdorsy changed the title Module not found: Can't resolve 'module' in '/Users/Documents/git/fwota-ui/node_modules/require-from-string' Module not found: Can't resolve 'module' in '/Users/Documents/git/project-name/node_modules/require-from-string' Apr 7, 2018
@jpdorsy jpdorsy closed this as completed Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants