Khan / Khan/aphrodite

calling css() causes an error/styles wont apply

Open
#323 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
187
PR merge metrics
No merged PRs in 30d

Description

```
VM18771:97 Uncaught TypeError: process.nextTick is not a function
at requestFlush (eval at _default (get-es6-exports.js:26), :97:17)
at rawAsap (eval at _default (get-es6-exports.js:26), :20:9)
at asap (eval at _default (get-es6-exports.js:26), :28:5)
at injectGeneratedCSSOnce (eval at _default (get-es6-exports.js:26), :820:9)
at injectStyleOnce (eval at _default (get-es6-exports.js:26), :840:5)
at injectAndGetClassName (eval at _default (get-es6-exports.js:26), :944:5)
at css (eval at _default (get-es6-exports.js:26), :1155:24)
at CustomComponent.render (eval at _default (get-es6-exports.js:26), :44:36)
at finishClassComponent (react-dom.development.js:7873)
at updateClassComponent (react-dom.development.js:7850)
```

my code:
```
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, css } from 'aphrodite';

const styles = StyleSheet.create({
wrapper: {
width: '100px',
height: '100px',
}
})

export default class CustomComponent extends Component {
static propTypes = {
getAttributes: PropTypes.func.isRequired,
};

static defaultProps = {};

render() {
const { getAttributes } = this.props;

console.log(css(styles.wrapper)); /// <--- ERROR's HERE

return (

// <--Also error's here when not commented out
);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the stack trace at requestFlush, where process.nextTick is reported as unavailable, and reproduce the failure by calling css(styles.wrapper) in the provided CustomComponent example. Determine why style injection reaches that path in this environment; done means css() no longer throws and the component styles apply.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.