question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When I use next import I can see error and my build will fail

import quiz from './queries/quiz.graphql';
import quizzes from './queries/quizzes.graphql';
/Users/seeden/Documents/git/quizana-ui/node_modules/babel-core/lib/transformation/file/index.js:590
      throw err;
      ^

TypeError: /src/graphql/quiz/typeDefs.js: Cannot read property 'type' of undefined
    at Whitespace.getNewlinesAfter (/node_modules/babel-generator/lib/whitespace.js:50:19)
    at Generator._printNewline (/node_modules/babel-generator/lib/printer.js:459:34)
    at Generator.printJoin (/node_modules/babel-generator/lib/printer.js:376:32)
    at Generator.printList (/node_modules/babel-generator/lib/printer.js:430:17)
    at Generator.ObjectExpression (/node_modules/babel-generator/lib/generators/types.js:57:10)
    at /node_modules/babel-generator/lib/printer.js:298:23
    at Buffer.withSource (/node_modules/babel-generator/lib/buffer.js:168:5)
    at Generator.withSource (/node_modules/babel-generator/lib/printer.js:189:15)
    at Generator.print (/node_modules/babel-generator/lib/printer.js:297:10)
    at Generator.ArrayExpression (/node_modules/babel-generator/lib/generators/types.js:106:12)

But when I change quiz => quizQuery evrything is fine.

import quizQuery from './queries/quiz.graphql';
import quizzes from './queries/quizzes.graphql';

I have really no idea what is wrong with names. I have same error across whole project.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:46 (23 by maintainers)

github_iconTop GitHub Comments

7reactions
MatthieuLemoinecommented, Jan 17, 2018

I made a PR to babel-generator to fix this issue https://github.com/babel/babel/pull/7205.

I need some thumbups to make sure that a new version of Babel 6 will be released with this fix.

5reactions
xuxucodecommented, Nov 27, 2017

<del>2.0.3-beta.2 works for me, thanks 👍 </del>

Update (2017/11/27)

Sorry, it still happens, I have to add a blank line above the import to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
Read more >
Python Exception Handling: ImportError and ... - Airbrake Blog
The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to ...
Read more >
import error: 'No module named' *does* exist - python
I set the PYTHONPATH to '.' and that solved it for me. export PYTHONPATH='.' For a one-liner you could as easily do: PYTHONPATH='....
Read more >
How to catch ImportError Exception in Python? - Tutorialspoint
ImportError is raised when a module, or member of a module, cannot be imported. There are a two conditions where an ImportError might...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found