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.

getting error in a file written in ES6

See original GitHub issue

The file is https://github.com/ritz078/react-filters/blob/canary/components/Slider/Slider.js

The error I get is

Error with path "./components/Slider/Slider.js": Error: [{type: ImportDefaultSpecifier, start: 370, end: 374, loc: [object Object], local: [object Object], id: null, name: null}] does not match type Printable
Error: [{type: ImportDefaultSpecifier, start: 370, end: 374, loc: [object Object], local: [object Object], id: null, name: null}] does not match type Printable
    at Type.Tp.assert (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/node_modules/ast-types/lib/types.js:56:15)
    at genericPrintNoParens (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:219:26)
    at genericPrint (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:164:9)
    at printRootGenerically (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:105:15)
    at maybeReprint (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:97:16)
    at print (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:75:29)
    at exports.printComments (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/comments.js:324:22)
    at printWithComments (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:61:16)
    at print (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:66:20)
    at Printer.print (/Users/ritz078/.npm-packages/lib/node_modules/react-docgen/node_modules/recast/lib/printer.js:118:21)

The command I ran was react-docgen ./components/Slider/Slider.js

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
levithomasoncommented, Aug 25, 2016

Confirming imported defaults now work, very much appreciated @fkling.

import { Checkbox } from '../../modules'

Radio.defaultProps = {
  as: Checkbox,
}
0reactions
levithomasoncommented, Aug 25, 2016

Nice! Testing 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript ES6 import module "File is not a module error"
When I am trying to compile the main.ts file I get this error: Error TS2306: File 'test.ts' is not a module. How can...
Read more >
Custom JavaScript Errors in ES6 - Jamund Ferguson
One of the common ways to handle this is to append errors with custom properties (which is used heavily in node.js itself.) var...
Read more >
Error - JavaScript - MDN Web Docs - Mozilla
Runtime errors result in new Error objects being created and thrown. Error is a serializable object, so it can be cloned with structuredClone() ......
Read more >
ES6 - Error Handling - Tutorialspoint
ES6 - Error Handling, There are three types of errors in programming: Syntax Errors, Runtime Errors, and Logical Errors.
Read more >
rollup.js
You can provide an optional Rollup configuration file to simplify command line usage and enable advanced Rollup functionality.
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