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.

Error: We don't know what to do with this node type .....

See original GitHub issue

Since this is a legacy/maintain old functionality plugin, I’m just reporting this, I realise it may not be worth fixing, the plugin is great anyway and has saved me a lot of trouble 😃

The following (stripped down a bit) works:

import CSSModules from 'react-css-modules' ;
import styles from './accordion.css' ;
export function layoutAccordion (Header, Content) {
    class __Accordion extends React.Component {
        ....
        }
    return CSSModules(__Accordion, styles) ;
    }

but the decorated version doesn’t:

import CSSModules from 'react-css-modules' ;
import styles from './accordion.css' ;
export function layoutAccordion (Header, Content) {
    @CSSModules(styles)
    class __Accordion extends React.Component {
        ....
        }
    return __Accordion
    }

The full error:

Error: app/layout/accordion.js: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
    at NodePath.insertBefore (/usr/lib/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/path/modification.js:62:13)
    at NodePath.unshiftContainer (/usr/lib/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/path/modification.js:254:15)
    at Scope.push (/usr/lib/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:1031:41)
    at Scope.generateDeclaredUidIdentifier (/usr/lib/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:308:10)
    at /home/mike/applify2/node_modules/babel-plugin-transform-decorators-legacy/lib/index.js:27:56
    at Array.map (native)
    at applyEnsureOrdering (/home/mike/applify2/node_modules/babel-plugin-transform-decorators-legacy/lib/index.js:25:53)
    at PluginPass.ClassExpression (/home/mike/applify2/node_modules/babel-plugin-transform-decorators-legacy/lib/index.js:223:38)
    at newFn (/usr/lib/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:278:19)
    at NodePath._call (/usr/lib/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:76:18)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
loganfsmythcommented, Dec 13, 2015

This sounds like an instance of https://phabricator.babeljs.io/T3051, if you update your version of babel-traverse you should be all set.

0reactions
silkentrancecommented, Dec 18, 2015

@loganfsmyth perhaps we should tell npm@3.3.4 to behave that way 😁, at least on my system, that is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: We don't know what to do with this node type. We were ...
I 'm reporting an error I get for every React component exported after I upgraded to @babel/*@^7.0.0-beta.37: ERROR in ./apps/visitor/components/ ...
Read more >
Error in Reprocessing IDOCS - SAP Community
I am facing a problem while reprocessing an inbound IDOC of type DESADV. I have few I which have gone into error. The...
Read more >
AWS ParallelCluster Troubleshooting
Check the clustermgtd ( /var/log/parallelcluster/clustermgtd ) log to see if instances were launched for the node. If they weren't launched, there should be ......
Read more >
HTML DOM Element nodeType Property - W3Schools
The nodeType property returns the node type, as a number, of the specified node. If the node is an element node, the nodeType...
Read more >
Errors | Node.js v19.3.0 Documentation
Errors #. Applications running in Node.js will generally experience four categories of errors: Standard JavaScript errors such as <EvalError>, <SyntaxError>, ...
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