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

When launching npm run dev, jsx error is shown #2

Closed
arryon opened this issue Dec 15, 2017 · 5 comments
Closed

When launching npm run dev, jsx error is shown #2

arryon opened this issue Dec 15, 2017 · 5 comments
Labels

Comments

@arryon
Copy link

arryon commented Dec 15, 2017

I like your initiative for this collaborative app :). However, from the master branch I can't launch a working application. I'm using node v8.9 and ran npm install from the source dir. After npm run dev webpack compiles succesfully but an error occurs at the web page:

StyleSheet: `insertRule` accepts only strings.
Error: StyleSheet: `insertRule` accepts only strings.
    at invariant (/Users/arryon/projects/c-spotify/node_modules/styled-jsx/dist/lib/stylesheet.js:274:11)
    at StyleSheet.insertRule (/Users/arryon/projects/c-spotify/node_modules/styled-jsx/dist/lib/stylesheet.js:125:7)
    at /Users/arryon/projects/c-spotify/node_modules/styled-jsx/dist/stylesheet-registry.js:88:29
    at Array.map (<anonymous>)
    at StyleSheetRegistry.add (/Users/arryon/projects/c-spotify/node_modules/styled-jsx/dist/stylesheet-registry.js:87:27)
    at JSXStyle.componentWillMount (/Users/arryon/projects/c-spotify/node_modules/styled-jsx/dist/style.js:58:26)
    at resolve (/Users/arryon/projects/c-spotify/node_modules/react-dom/cjs/react-dom-server.node.development.js:2119:12)
    at ReactDOMServerRenderer.render (/Users/arryon/projects/c-spotify/node_modules/react-dom/cjs/react-dom-server.node.development.js:2260:22)
    at ReactDOMServerRenderer.read (/Users/arryon/projects/c-spotify/node_modules/react-dom/cjs/react-dom-server.node.development.js:2234:19)
    at renderToString (/Users/arryon/projects/c-spotify/node_modules/react-dom/cjs/react-dom-server.node.development.js:2501:25)

Searching a bit yielded This issue: vercel/next.js#3442

Seems like what you're doing (defining styles in the render() function) is no longer supported by next.

@JMPerez JMPerez added the bug label Dec 15, 2017
@JMPerez
Copy link
Owner

JMPerez commented Dec 15, 2017

@arryon Thanks for reporting it! Unfortunately I don't have much time these days to fix these issues. It would be great if you (or anyone else reading this) could contribute back with a PR.

@arryon
Copy link
Author

arryon commented Dec 15, 2017

I would love to, but I'm missing the required expertise with React to be able to pinpoint the exact origin of the error (which component etc). I'm currently trying an older commit from this repo to see if I can get a working app to start with.

Do you have tips for debugging in such a way that I can see in which component the jsx style errors?

@arryon
Copy link
Author

arryon commented Dec 15, 2017

Can confirm that your initial 'Push project' commit works, besides #1 where indeed prop-types@15.5.10 and jsx-styles@1.0.8 were missing from package.json.

@cavpollo
Copy link

Here is a PR to fix the bug 🙂

@JMPerez
Copy link
Owner

JMPerez commented Sep 28, 2018

Should be fixed by #4

@JMPerez JMPerez closed this as completed Sep 28, 2018
neildevas added a commit to neildevas/c that referenced this issue Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants