Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Low priority: Getting error when tried to create docs for other mono-repo #181

Open
ajaymathur opened this issue Jul 28, 2019 · 2 comments

Comments

@ajaymathur
Copy link
Contributor

Hey, I tried running brisk to create docs website for extract-react-types but I got the following error:

ModuleBuildError: Module build failed (from /Users/amathur/workspace/extract-react-types/node_modules/next/dist/build/webpack/loaders/next-babel-loader.js):
TypeError: Property expression of JSXExpressionContainer expected node to be of a type ["Expression","JSXEmptyExpression"] but instead got null
    at Object.validate (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/@babel/types/lib/definitions/utils.js:131:13)
    at validateField (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/@babel/types/lib/validators/validate.js:22:9)
    at validate (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/@babel/types/lib/validators/validate.js:16:3)
    at builder (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/@babel/types/lib/builders/builder.js:46:27)
    at Object.JSXExpressionContainer (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/@babel/types/lib/builders/generated/index.js:767:31)
    at propertiesReducer (/Users/amathur/workspace/extract-react-types/node_modules/babel-plugin-styled-components/lib/visitors/transpileCssProp.js:124:83)
    at Array.reduce (<anonymous>)
    at /Users/amathur/workspace/extract-react-types/node_modules/babel-plugin-styled-components/lib/visitors/transpileCssProp.js:110:39
    at PluginPass.JSXAttribute (/Users/amathur/workspace/extract-react-types/node_modules/babel-plugin-styled-components/lib/index.js:32:46)
    at NodePath._call (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitMultiple (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/context.js:85:17)
    at TraversalContext.visit (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/context.js:144:19)
    at Function.traverse.node (/Users/amathur/workspace/extract-react-types/node_modules/@babel/traverse/lib/index.js:94:17)
    at runLoaders (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/webpack/lib/NormalModule.js:301:20)
    at /Users/amathur/workspace/extract-react-types/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /Users/amathur/workspace/extract-react-types/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/Users/amathur/workspace/extract-react-types/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at loader.call.then.err (/Users/amathur/workspace/extract-react-types/node_modules/next/node_modules/babel-loader/lib/index.js:45:103)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Please treat this issue as low priority. I just wanted to surface this. Thanks.

@Noviny
Copy link
Contributor

Noviny commented Oct 9, 2019

Hi!

This appears to be a bug in babel-plugin-styled-components. This error message is mentioned here and although what we are encountering doesn't exactly match what is reported there, by process of experimenting with 'works on my machine' I validated that downgrading the version of this plugin to be exactly 1.10.0 'fixes' the problem.

Since you may not be directly depending on this - you can copy/paste this in the yarn.lock to replace your current resolution (normal caveats about editing a yarn.lock apply)

babel-plugin-styled-components@^1.10.0:
  version "1.10.0"
  resolved "https://packages.atlassian.com/api/npm/npm-remote/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.0.tgz#ff1f42ad2cc78c21f26b62266b8f564dbc862939"
  integrity sha512-sQVKG8irFXx14ZfaK1bBePirfkacl3j8nZwSZK+ZjsbnadRHKQTbhXbe/RB1vT6Vgkz45E+V95LBq4KqdhZUNw==
  dependencies:
    "@babel/helper-annotate-as-pure" "^7.0.0"
    "@babel/helper-module-imports" "^7.0.0"
    babel-plugin-syntax-jsx "^6.18.0"
    lodash "^4.17.10"

This issue will be closed once we have published the fix found in this branch to npm.

@ajaymathur
Copy link
Contributor Author

Thanks a lot for finding it out :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants